diff options
author | Craig Earls <enderw88@gmail.com> | 2014-09-13 18:24:54 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-09-13 18:24:54 -0700 |
commit | 514cee9761f83855cc722680e1deebdd5bfc39c5 (patch) | |
tree | aa4e98f6a36739a4cc1f11864170b25c5034d1c5 /lisp | |
parent | 7846e7c17ae31fdf71bea093e7410b90e284c04d (diff) | |
download | ledger-514cee9761f83855cc722680e1deebdd5bfc39c5.tar.gz ledger-514cee9761f83855cc722680e1deebdd5bfc39c5.tar.bz2 ledger-514cee9761f83855cc722680e1deebdd5bfc39c5.zip |
sort required a next xact function that ignores directives
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ledger-navigate.el | 18 | ||||
-rw-r--r-- | lisp/ledger-sort.el | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/lisp/ledger-navigate.el b/lisp/ledger-navigate.el index 949654e4..1cbde11d 100644 --- a/lisp/ledger-navigate.el +++ b/lisp/ledger-navigate.el @@ -26,15 +26,15 @@ (provide 'ledger-navigate) -;; (defun ledger-navigate-next-xact-or-directive () -;; "Move point to beginning of next xact." -;; ;; make sure we actually move to the next xact, even if we are the -;; ;; beginning of one now. -;; (if (looking-at ledger-payee-any-status-regex) -;; (forward-line)) -;; (if (re-search-forward ledger-payee-any-status-regex nil t) -;; (goto-char (match-beginning 0)) -;; (goto-char (point-max)))) +(defun ledger-navigate-next-xact () + "Move point to beginning of next xact." + ;; make sure we actually move to the next xact, even if we are the + ;; beginning of one now. + (if (looking-at ledger-payee-any-status-regex) + (forward-line)) + (if (re-search-forward ledger-payee-any-status-regex nil t) + (goto-char (match-beginning 0)) + (goto-char (point-max)))) (defun ledger-navigate-start-xact-or-directive-p () "return t if at the beginning of an empty line or line diff --git a/lisp/ledger-sort.el b/lisp/ledger-sort.el index 1ac125a9..9b717113 100644 --- a/lisp/ledger-sort.el +++ b/lisp/ledger-sort.el @@ -104,10 +104,10 @@ (save-restriction (goto-char beg) ;; make sure point is at the beginning of a xact - (ledger-navigate-next-xact-or-directive) + (ledger-navigate-next-xact) (setq new-beg (point)) (goto-char end) - (ledger-navigate-next-xact-or-directive) + (ledger-navigate-next-xact) ;; make sure end of region is at the beginning of next record ;; after the region (setq new-end (point)) @@ -117,7 +117,7 @@ (let ((inhibit-field-text-motion t)) (sort-subr nil - 'ledger-navigate-next-xact-or-directive + 'ledger-navigate-next-xact 'ledger-navigate-end-of-xact 'ledger-sort-startkey)))) |