Seems to be working. I wasn't ensuring I caught all the xacts in a region specified by hit lock.

Now I need to prune code
This commit is contained in:
Craig Earls 2014-09-08 20:31:45 -07:00
parent 77e77f39dc
commit 57e2ec55eb

View file

@ -65,19 +65,17 @@
(defun ledger-fontify-buffer-part (beg end len)
(save-excursion
;; (message (concat "ledger-fontify-buffer-part: "
;; (int-to-string beg) " "
;; (int-to-string end) " "
;; (int-to-string len)
;; ))
; (goto-char beg)
(backward-paragraph)
(forward-char)
(cond ((or (looking-at ledger-xact-start-regex)
(looking-at ledger-posting-regex))
(ledger-fontify-xact-at (point)))
((looking-at ledger-directive-start-regex)
(ledger-fontify-directive-at (point))))))
(unless beg (setq beg (point-min)))
(unless end (setq end (point-max)))
(unless len (setq len (- end beg)))
(goto-char beg)
(while (< (point) end)
(cond ((or (looking-at ledger-xact-start-regex)
(looking-at ledger-posting-regex))
(ledger-fontify-xact-at (point)))
((looking-at ledger-directive-start-regex)
(ledger-fontify-directive-at (point))))
(ledger-xact-next-xact-or-directive))))
(defun ledger-fontify-xact-at (position)
(interactive "d")