summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-09-05 21:59:23 -0700
committerCraig Earls <enderw88@gmail.com>2014-09-05 21:59:23 -0700
commit77e77f39dcb99df410e969f7bd6c574e4d05dbe8 (patch)
treeff96211233dbb5e5c061d49445690ac5e65d5e1d
parent991d162fb0a17305f8f43d9bf1f566d8227b54ec (diff)
downloadfork-ledger-77e77f39dcb99df410e969f7bd6c574e4d05dbe8.tar.gz
fork-ledger-77e77f39dcb99df410e969f7bd6c574e4d05dbe8.tar.bz2
fork-ledger-77e77f39dcb99df410e969f7bd6c574e4d05dbe8.zip
Solved the fight between jit-lock. But for some reason it isn't calling it for all regions in the buffer.
-rw-r--r--lisp/ledger-fontify.el2
-rw-r--r--lisp/ledger-mode.el7
2 files changed, 5 insertions, 4 deletions
diff --git a/lisp/ledger-fontify.el b/lisp/ledger-fontify.el
index 7621b448..f282167e 100644
--- a/lisp/ledger-fontify.el
+++ b/lisp/ledger-fontify.el
@@ -63,7 +63,7 @@
(if (string= (format-mode-line 'mode-name) "Ledger")
(add-hook 'after-change-functions 'ledger-fontify-buffer-part)))
-(defun ledger-fontify-buffer-part (beg end)
+(defun ledger-fontify-buffer-part (beg end len)
(save-excursion
;; (message (concat "ledger-fontify-buffer-part: "
;; (int-to-string beg) " "
diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el
index 1f6d8c32..94b1f591 100644
--- a/lisp/ledger-mode.el
+++ b/lisp/ledger-mode.el
@@ -347,14 +347,15 @@ With a prefix argument, remove the effective date. "
(if (boundp 'font-lock-defaults)
(setq-local font-lock-defaults
- '(ledger-font-lock-keywords t t)))
+ '(ledger-font-lock-keywords t t nil nil
+ (font-lock-fontify-region-function . ledger-fontify-buffer-part))))
;; (setq font-lock-extend-region-functions
;; (list #'font-lock-extend-region-wholelines))
;; (setq font-lock-multiline nil)
- (jit-lock-register 'ledger-fontify-buffer-part)
- (jit-lock-unregister 'font-lock-fontify-region)
+ ;(jit-lock-register 'ledger-fontify-buffer-part)
+ ;(jit-lock-unregister 'font-lock-fontify-region)
(setq-local pcomplete-parse-arguments-function 'ledger-parse-arguments)
(setq-local pcomplete-command-completion-function 'ledger-complete-at-point)