diff options
author | Craig Earls <enderw88@gmail.com> | 2013-03-26 02:33:05 -0400 |
---|---|---|
committer | Craig Earls <enderw88@gmail.com> | 2013-03-26 02:33:05 -0400 |
commit | f1882d0a56f8b5828aaadfe06e5207a9b43d2ef0 (patch) | |
tree | ec001a4958708e97130d1b6a30b4cd1f9f3867b6 /lisp/ldg-state.el | |
parent | fec1c179e33225778fa4b69667d5382e7a2b5718 (diff) | |
download | ledger-f1882d0a56f8b5828aaadfe06e5207a9b43d2ef0.tar.gz ledger-f1882d0a56f8b5828aaadfe06e5207a9b43d2ef0.tar.bz2 ledger-f1882d0a56f8b5828aaadfe06e5207a9b43d2ef0.zip |
Major speed improvements to ledger-post-align-postings
Got rid of markers. Use inhibit-modification-hook to suppress any other buffer stuff happening.
Got giant-buffer down to around 3.5 seconds with full modifications.
Diffstat (limited to 'lisp/ldg-state.el')
-rw-r--r-- | lisp/ldg-state.el | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lisp/ldg-state.el b/lisp/ldg-state.el index 88891aff..4f1b3695 100644 --- a/lisp/ldg-state.el +++ b/lisp/ldg-state.el @@ -122,12 +122,10 @@ dropped." ;;this excursion toggles the posting status (save-excursion - (let ((has-align-hook (remove-hook - 'after-change-functions - 'ledger-post-maybe-align t))) + (setq inhibit-modification-hooks t) - (goto-char (line-beginning-position)) - (when (looking-at "[ \t]") + (goto-char (line-beginning-position)) + (when (looking-at "[ \t]") (skip-chars-forward " \t") (let ((here (point)) (cur-status (ledger-state-from-char (char-after)))) @@ -162,8 +160,7 @@ dropped." ((looking-at " ") (delete-char 1)))) (setq new-status inserted)))) - (if has-align-hook - (add-hook 'after-change-functions 'ledger-post-maybe-align t t)))) + (setq inhibit-modification-hooks nil)) ;; This excursion cleans up the entry so that it displays ;; minimally. This means that if all posts are cleared, remove |