diff options
author | Craig Earls <enderw88@gmail.com> | 2013-03-30 07:30:40 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2013-03-30 07:30:40 -0700 |
commit | 69c0927772f74fd0c45b1250c171e86cc205c76d (patch) | |
tree | 2e525b433191d23fe2f97b7f1ee2e881a99e6aa9 /lisp | |
parent | 7fea9d21fb72e1d66423a928297dd3cc29c7cc78 (diff) | |
download | fork-ledger-69c0927772f74fd0c45b1250c171e86cc205c76d.tar.gz fork-ledger-69c0927772f74fd0c45b1250c171e86cc205c76d.tar.bz2 fork-ledger-69c0927772f74fd0c45b1250c171e86cc205c76d.zip |
Fix bug 937 maintain sort order of xact on the same actual date.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ldg-sort.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ldg-sort.el b/lisp/ldg-sort.el index ecb86371..45b55c47 100644 --- a/lisp/ldg-sort.el +++ b/lisp/ldg-sort.el @@ -64,13 +64,17 @@ (beginning-of-line) (insert "\n; Ledger-mode: End sort\n\n")) +(defun ledger-sort-startkey () + "Return the actual date so the sort-subr doesn't sort onthe entire first line." + (buffer-substring-no-properties (point) (+ 10 (point)))) + (defun ledger-sort-region (beg end) "Sort the region from BEG to END in chronological order." (interactive "r") ;; load beg and end from point and mark ;; automagically (let ((new-beg beg) (new-end end)) - (save-excursion + (save-excursion (save-restriction (goto-char beg) (ledger-next-record-function) ;; make sure point is at the @@ -88,7 +92,8 @@ (sort-subr nil 'ledger-next-record-function - 'ledger-end-record-function)))))) + 'ledger-end-record-function + 'ledger-sort-startkey)))))) (defun ledger-sort-buffer () "Sort the entire buffer." |