diff options
Diffstat (limited to 'lisp/ldg-xact.el')
-rw-r--r-- | lisp/ldg-xact.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/ldg-xact.el b/lisp/ldg-xact.el new file mode 100644 index 00000000..5945632a --- /dev/null +++ b/lisp/ldg-xact.el @@ -0,0 +1,20 @@ +;; 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)))))) + |