diff options
author | Craig Earls <enderw88@gmail.com> | 2014-12-04 19:47:43 -0700 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2014-12-04 19:47:43 -0700 |
commit | bb38cda880f8abeb75570246b79935e437741afa (patch) | |
tree | 42e3d99b8e5e8aff2ec69091cc7407736750fe3c /lisp | |
parent | b3f8f943d31b393193e6094c650e55ab2720d9d7 (diff) | |
download | fork-ledger-bb38cda880f8abeb75570246b79935e437741afa.tar.gz fork-ledger-bb38cda880f8abeb75570246b79935e437741afa.tar.bz2 fork-ledger-bb38cda880f8abeb75570246b79935e437741afa.zip |
Adjust navigate-find-end-of-act so that it will sort empty act.
This is a bit pathological but as it turns out the fix makes all sorting a bit faster.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ledger-navigate.el | 2 | ||||
-rw-r--r-- | lisp/ledger-sort.el | 34 |
2 files changed, 5 insertions, 31 deletions
diff --git a/lisp/ledger-navigate.el b/lisp/ledger-navigate.el index d954222f..5afcb50d 100644 --- a/lisp/ledger-navigate.el +++ b/lisp/ledger-navigate.el @@ -78,7 +78,7 @@ beginning with whitespace" "Move point to end of xact." (interactive) (ledger-navigate-next-xact-or-directive) - (re-search-backward "^[ \t]") + (re-search-backward ".$") (end-of-line) (point)) diff --git a/lisp/ledger-sort.el b/lisp/ledger-sort.el index 9b717113..534d3b24 100644 --- a/lisp/ledger-sort.el +++ b/lisp/ledger-sort.el @@ -26,46 +26,19 @@ ;;; Code: -;; (defun ledger-next-record-function () -;; "Move point to next transaction." -;; ;; make sure we actually move to the next xact, even if we are the -;; ;; beginning of one now. -;; (if (looking-at ledger-payee-any-status-regex) -;; (forward-line)) -;; (if (re-search-forward ledger-payee-any-status-regex nil t) -;; (goto-char (match-beginning 0)) -;; (goto-char (point-max)))) - -;; (defun ledger-prev-record-function () -;; "Move point to beginning of previous xact." -;; (ledger-beginning-record-function) -;; (re-search-backward ledger-xact-start-regex nil t)) - -;; (defun ledger-beginning-record-function () -;; "Move point to the beginning of the current xact" -;; (interactive) -;; (unless (looking-at ledger-xact-start-regex) -;; (re-search-backward ledger-xact-start-regex nil t) -;; (beginning-of-line)) -;; (point)) - -;; (defun ledger-end-record-function () -;; "Move point to end of xact." -;; (interactive) -;; (ledger-navigate-next-xact) -;; (backward-char) -;; (end-of-line) -;; (point)) (defun ledger-sort-find-start () + "Find the beginning of a sort region" (if (re-search-forward ";.*Ledger-mode:.*Start sort" nil t) (match-end 0))) (defun ledger-sort-find-end () + "Find the end of a sort region" (if (re-search-forward ";.*Ledger-mode:.*End sort" nil t) (match-end 0))) (defun ledger-sort-insert-start-mark () + "Insert a marker to start a sort region" (interactive) (save-excursion (goto-char (point-min)) @@ -75,6 +48,7 @@ (insert "\n; Ledger-mode: Start sort\n\n")) (defun ledger-sort-insert-end-mark () + "Insert a marker to end a sort region" (interactive) (save-excursion (goto-char (point-min)) |