summaryrefslogtreecommitdiff
path: root/lisp/ledger-xact.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-09-10 07:16:32 -0700
committerCraig Earls <enderw88@gmail.com>2014-09-10 07:16:32 -0700
commitbfc925f52f29335f79882230b744481e567bf8df (patch)
tree6aac1a5c31731932e2369a0190f916ee1315eabd /lisp/ledger-xact.el
parent0f9212071ac65b9af46187c03adeecc3a76acaa8 (diff)
downloadledger-bfc925f52f29335f79882230b744481e567bf8df.tar.gz
ledger-bfc925f52f29335f79882230b744481e567bf8df.tar.bz2
ledger-bfc925f52f29335f79882230b744481e567bf8df.zip
Minor refactoring and code cleanup
Diffstat (limited to 'lisp/ledger-xact.el')
-rw-r--r--lisp/ledger-xact.el33
1 files changed, 25 insertions, 8 deletions
diff --git a/lisp/ledger-xact.el b/lisp/ledger-xact.el
index b16e5d85..277788e6 100644
--- a/lisp/ledger-xact.el
+++ b/lisp/ledger-xact.el
@@ -212,7 +212,7 @@ beginning with whitespace"
(not (looking-at "[ \t]\\|\\(^$\\)")))
(defun ledger-xact-next-xact-or-directive ()
- "move to the beginning of the next xact"
+ "move to the beginning of the next xact or directive"
(interactive)
(beginning-of-line)
(if (ledger-xact-start-xact-or-directive-p) ; if we are the start of an xact, move forward to the next xact
@@ -224,13 +224,30 @@ beginning with whitespace"
(ledger-xact-start-xact-or-directive-p)))
(forward-line))))
-(defun ledger-xact-next-xact ()
- (interactive)
- (beginning-of-line)
- (if (looking-at ledger-xact-start-regex)
- (forward-line))
- (re-search-forward ledger-xact-start-regex)
- (forward-line -1))
+(defun ledger-xact-prev-xact ()
+ "Move point to the previous transaction."
+ (interactive)
+ (backward-paragraph)
+ (when (re-search-backward ledger-xact-line-regexp nil t)
+ (goto-char (match-beginning 0))
+ (re-search-forward ledger-post-line-regexp)
+ (goto-char (match-end ledger-regex-post-line-group-account))))
+
+;; (defun ledger-post-next-xact ()
+;; "Move point to the next transaction."
+;; (interactive)
+;; (when (re-search-forward ledger-xact-line-regexp nil t)
+;; (goto-char (match-beginning 0))
+;; (re-search-forward ledger-post-line-regexp)
+;; (goto-char (match-end ledger-regex-post-line-group-account))))
+
+;; (defun ledger-xact-next-xact ()
+;; (interactive)
+;; (beginning-of-line)
+;; (if (looking-at ledger-xact-start-regex)
+;; (forward-line))
+;; (re-search-forward ledger-xact-start-regex)
+;; (forward-line -1))
(provide 'ledger-xact)