sort required a next xact function that ignores directives

This commit is contained in:
Craig Earls 2014-09-13 18:24:54 -07:00
parent 7846e7c17a
commit 514cee9761
2 changed files with 12 additions and 12 deletions

View file

@ -26,15 +26,15 @@
(provide 'ledger-navigate) (provide 'ledger-navigate)
;; (defun ledger-navigate-next-xact-or-directive () (defun ledger-navigate-next-xact ()
;; "Move point to beginning of next xact." "Move point to beginning of next xact."
;; ;; make sure we actually move to the next xact, even if we are the ;; make sure we actually move to the next xact, even if we are the
;; ;; beginning of one now. ;; beginning of one now.
;; (if (looking-at ledger-payee-any-status-regex) (if (looking-at ledger-payee-any-status-regex)
;; (forward-line)) (forward-line))
;; (if (re-search-forward ledger-payee-any-status-regex nil t) (if (re-search-forward ledger-payee-any-status-regex nil t)
;; (goto-char (match-beginning 0)) (goto-char (match-beginning 0))
;; (goto-char (point-max)))) (goto-char (point-max))))
(defun ledger-navigate-start-xact-or-directive-p () (defun ledger-navigate-start-xact-or-directive-p ()
"return t if at the beginning of an empty line or line "return t if at the beginning of an empty line or line

View file

@ -104,10 +104,10 @@
(save-restriction (save-restriction
(goto-char beg) (goto-char beg)
;; make sure point is at the beginning of a xact ;; make sure point is at the beginning of a xact
(ledger-navigate-next-xact-or-directive) (ledger-navigate-next-xact)
(setq new-beg (point)) (setq new-beg (point))
(goto-char end) (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 ;; make sure end of region is at the beginning of next record
;; after the region ;; after the region
(setq new-end (point)) (setq new-end (point))
@ -117,7 +117,7 @@
(let ((inhibit-field-text-motion t)) (let ((inhibit-field-text-motion t))
(sort-subr (sort-subr
nil nil
'ledger-navigate-next-xact-or-directive 'ledger-navigate-next-xact
'ledger-navigate-end-of-xact 'ledger-navigate-end-of-xact
'ledger-sort-startkey)))) 'ledger-sort-startkey))))