summaryrefslogtreecommitdiff
path: root/lisp/ledger.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-06 15:20:06 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-06 15:20:06 -0400
commit182d5df307626c244efe581f3d8e58578babeb99 (patch)
treed374a4f7705c64c61b07fb8a9f59c84870f08b33 /lisp/ledger.el
parent7c77a1af315a7c7d5eae822bb725ddd0a1bb32fe (diff)
downloadfork-ledger-182d5df307626c244efe581f3d8e58578babeb99.tar.gz
fork-ledger-182d5df307626c244efe581f3d8e58578babeb99.tar.bz2
fork-ledger-182d5df307626c244efe581f3d8e58578babeb99.zip
Extended Ledger's font-lock expression, based on code from Timothy Stotts.
Diffstat (limited to 'lisp/ledger.el')
-rw-r--r--lisp/ledger.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/ledger.el b/lisp/ledger.el
index dffbb340..d7d6d0eb 100644
--- a/lisp/ledger.el
+++ b/lisp/ledger.el
@@ -129,11 +129,17 @@ text that should replace the format specifier."
(defvar bold 'bold)
(defvar ledger-font-lock-keywords
- `((,(concat "^[0-9/.=-]+\\(\\s-+\\*\\)?\\(\\s-+(.*?)\\)?\\s-+"
- "\\(.+?\\)\\(\t\\|\n\\| [ \t]\\)") 3 bold)
- (";.+" . font-lock-comment-face)
- ("^\\s-+.+?\\( \\|\t\\|\n\\|\\s-+$\\)" . font-lock-keyword-face))
- "Default expressions to highlight in Ledger mode.")
+ '(("^[0-9./=]+\\s-+\\(?:([^)]+)\\s-+\\)?\\([^*].+\\)" 1 bold)
+ ("\s \\{5,\\}\\([$]-[0-9][0-9,.]*\\)" 1 font-lock-warning-face)
+ ("\s \\{5,\\}\\(-?[0-9][0-9,.]*\\)" 1 font-lock-type-face)
+ ("^\\s-+.+?\\( \\|\t\\|\n\\|\\s-+$\\)" . font-lock-keyword-face)
+ ("^\s +\\((\\)\\([A-Za-z0-9]+:[A-Za-z0-9]+[A-Za-z0-9: ]*\\)\\()\\)"
+ (1 font-lock-function-name-face)
+ (2 font-lock-variable-name-face)
+ (3 font-lock-function-name-face))
+ ("^[0-9]+[/-][0-9]+.*\\([*]\\)" 1 bold)
+ ("^\\([~=]\\)\\s " 1 font-lock-function-name-face))
+ "Improved expressions to highlight in Ledger mode.")
(defsubst ledger-current-year ()
(format-time-string "%Y"))