summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-12-09 11:24:34 -0800
committerCraig Earls <enderw88@gmail.com>2013-12-09 11:24:34 -0800
commit123ada2f377c6bf20afebfcb65345b2c107723af (patch)
tree39f96f84d466142f1f2b0029d677764624124a72 /lisp
parent0e5867bc5c164036d4a4efbcb6e38f713d9ebacd (diff)
parenta74053b01012216a99c25859eaf386c78d69e4da (diff)
downloadfork-ledger-123ada2f377c6bf20afebfcb65345b2c107723af.tar.gz
fork-ledger-123ada2f377c6bf20afebfcb65345b2c107723af.tar.bz2
fork-ledger-123ada2f377c6bf20afebfcb65345b2c107723af.zip
Merge pull request #220 from purcell/ledger-mode-syntax-table
ledger-mode: define and use a syntax table so that comments are handled properly
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ledger-mode.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el
index a8a448b8..2f860f2f 100644
--- a/lisp/ledger-mode.el
+++ b/lisp/ledger-mode.el
@@ -168,6 +168,14 @@ Can indent, complete or align depending on context."
(ledger-mode-remove-extra-lines))
+(defvar ledger-mode-syntax-table
+ (let ((table (make-syntax-table)))
+ ;; Support comments via the syntax table
+ (modify-syntax-entry ?\; "< b" table)
+ (modify-syntax-entry ?\n "> b" table)
+ table)
+ "Syntax table for `ledger-mode' buffers.")
+
;;;###autoload
(define-derived-mode ledger-mode text-mode "Ledger"
"A mode for editing ledger data files."
@@ -175,6 +183,7 @@ Can indent, complete or align depending on context."
(ledger-schedule-check-available)
(ledger-post-setup)
+ (set-syntax-table ledger-mode-syntax-table)
(set (make-local-variable 'comment-start) "; ")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'indent-tabs-mode) nil)