[emacs] When the first line is a txn, include it in ledger-sort-buffer

Without this fix, ledger-sort-region tends to skip the first
transaction when sorting a region or the entire buffer.
This commit is contained in:
Steve Purcell 2014-12-09 14:40:39 +00:00
parent 7a0b004f9d
commit c8dd5d4a0a

View file

@ -79,6 +79,8 @@
(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) (ledger-navigate-next-xact)
(unless (looking-at ledger-payee-any-status-regex)
(ledger-navigate-next-xact))
(setq new-beg (point)) (setq new-beg (point))
(goto-char end) (goto-char end)
(ledger-navigate-next-xact) (ledger-navigate-next-xact)