This patch adds some extra color to the emacs mode. It
marks comments, numbers, dates, and the asterisk
character in different colors.
The account highlighting ("keyword") regexp was also
changed to fix a bug: transactions whose memo line
ended in a space were sometimes highlighted.
(Apparently, \\s-+ matches newlines, so I changed the
regexp to only match spaces or tabs)
-Michal
--- /usr/src/ledger-2.2/ledger.el Sat Feb 19 20:33:10
2005
+++ /Users/michal/lib/elisp/ledger.el Sat Mar 12
11:50:35 2005
@@ -64,5 +64,9 @@
(defvar ledger-font-lock-keywords
'(("^[0-9./]+\\s-+\\(?:([^)]+)\\s-+\\)?\\([^*].+\\)" 1 bold)
- ("^\\s-+.+?\\( \\|\t\\|\\s-+$\\)" . font-lock-keyword-face))
+ ("^;.*" . font-lock-comment-face) ; comments
+ ("\\s-+[*]\\s-+" . font-lock-builtin-face) ; clear mark
+ ("[0-9]\\{4\\}/[0-9]\\{2\\}/[0-9]\\{2\\}" . font-lock-
constant-face) ; dates
+ ("-?[0-9]+\\.[0-9]+" . font-lock-string-face) ; decimal
numbers
+ ("^[ \t]+.+?\\( \\|\t\\|\\s-+$\\)" . font-lock-keyword-
face))
"Default expressions to highlight in Ledger mode.")
Logged In: YES
user_id=845643
Please attach the patch as a file; sf.net mangles it if
pasted into the patch description. Thanks :)
a hopefully unmangled patch :)
Logged In: YES
user_id=1971
Whoops. Done. Thanks. :)
patch for ledger.el from 2.6.1
Logged In: YES
user_id=1971
Originator: YES
Here's an update against ledger.el from 2.6.1
File Added: newpatch.diff