From 1bd67755fa3127d80b7534d15f1f9de1b477c19a Mon Sep 17 00:00:00 2001 From: Craig Earls Date: Fri, 7 Nov 2014 18:19:57 -0700 Subject: Improve finding boundaries of elements for fontification. Also added P for price directives. --- lisp/ledger-fontify.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lisp/ledger-fontify.el') diff --git a/lisp/ledger-fontify.el b/lisp/ledger-fontify.el index 45baa433..d876e5e3 100644 --- a/lisp/ledger-fontify.el +++ b/lisp/ledger-fontify.el @@ -52,7 +52,7 @@ (interactive "d") (save-excursion (goto-char position) - (let ((extents (ledger-navigate-find-xact-extents position)) + (let ((extents (ledger-navigate-find-element-extents position)) (state (ledger-transaction-state))) (if (and ledger-fontify-xact-state-overrides state) (cond ((eq state 'cleared) @@ -115,7 +115,7 @@ Fontify the first line of an xact" 'ledger-font-comment-face))) (defun ledger-fontify-directive-at (position) - (let ((extents (ledger-navigate-find-xact-extents position)) + (let ((extents (ledger-navigate-find-element-extents position)) (face 'ledger-font-default-face)) (cond ((looking-at "=") (setq face 'ledger-font-auto-xact-face)) @@ -153,6 +153,8 @@ Fontify the first line of an xact" (setq face 'ledger-font-include-directive-face)) ((looking-at "payee") (setq face 'ledger-font-payee-directive-face)) + ((looking-at "P") + (setq face 'ledger-font-price-directive-face)) ((looking-at "tag") (setq face 'ledger-font-tag-directive-face))) (ledger-fontify-set-face extents face))) -- cgit v1.2.3