From b0ab334ddf156350550985b7a4ef5c0e8636bcc2 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Sat, 13 Dec 2014 17:09:11 +0000 Subject: [emacs] Add syntax table so that ";" comments are handled This allows things like goto-address-prog-mode to correctly highlight URLs inside comments. --- lisp/ledger-mode.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el index a85e0759..d14ea370 100644 --- a/lisp/ledger-mode.el +++ b/lisp/ledger-mode.el @@ -244,6 +244,13 @@ With a prefix argument, remove the effective date." (goto-char start) (search-forward target)))) +(defvar ledger-mode-syntax-table + (let ((table (make-syntax-table text-mode-syntax-table))) + (modify-syntax-entry ?\; "<" table) + (modify-syntax-entry ?\n ">" table) + table) + "Syntax table in use in `ledger-mode' buffers.") + (defvar ledger-mode-map (let ((map (make-sparse-keymap))) (define-key map [(control ?c) (control ?a)] 'ledger-add-transaction) @@ -322,10 +329,10 @@ With a prefix argument, remove the effective date." ["Kill Report" ledger-report-kill ledger-works])) ;;;###autoload - (define-derived-mode ledger-mode text-mode "Ledger" "A mode for editing ledger data files." (ledger-check-version) + (set-syntax-table ledger-mode-syntax-table) (when (boundp 'font-lock-defaults) (setq font-lock-defaults '(ledger-font-lock-keywords t t nil nil -- cgit v1.2.3