Menu

#2 more colors in ledger.el

open
nobody
None
5
2005-03-12
2005-03-12
No

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.")

Discussion

  • Peter Backes

    Peter Backes - 2005-03-13

    Logged In: YES
    user_id=845643

    Please attach the patch as a file; sf.net mangles it if
    pasted into the patch description. Thanks :)

     
  • michal wallace

    michal wallace - 2005-03-15

    a hopefully unmangled patch :)

     
  • michal wallace

    michal wallace - 2005-03-15

    Logged In: YES
    user_id=1971

    Whoops. Done. Thanks. :)

     
  • michal wallace

    michal wallace - 2007-05-01

    patch for ledger.el from 2.6.1

     
  • michal wallace

    michal wallace - 2007-05-01

    Logged In: YES
    user_id=1971
    Originator: YES

    Here's an update against ledger.el from 2.6.1
    File Added: newpatch.diff

     

Log in to post a comment.