blob: 6e14a14cf2a8b42a40b676469e1a63939dc0c4ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
;; A sample entry sorting function, which works if entry dates are of
;; the form YYYY/mm/dd.
(defun ledger-sort ()
(interactive)
(save-excursion
(goto-char (point-min))
(sort-subr
nil
(function
(lambda ()
(if (re-search-forward
(concat "^[0-9/.=-]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+"
"\\(.+?\\)\\(\t\\|\n\\| [ \t]\\)") nil t)
(goto-char (match-beginning 0))
(goto-char (point-max)))))
(function
(lambda ()
(forward-paragraph))))))
(provide 'ldg-xact)
|