summaryrefslogtreecommitdiff
path: root/lisp/ledger-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ledger-mode.el')
-rw-r--r--lisp/ledger-mode.el28
1 files changed, 6 insertions, 22 deletions
diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el
index 458c24b1..9291bf8f 100644
--- a/lisp/ledger-mode.el
+++ b/lisp/ledger-mode.el
@@ -35,6 +35,7 @@
(require 'ledger-context)
(require 'ledger-exec)
(require 'ledger-fonts)
+(require 'ledger-fontify)
(require 'ledger-init)
(require 'ledger-occur)
(require 'ledger-post)
@@ -228,15 +229,6 @@ With a prefix argument, remove the effective date. "
(ledger-post-align-postings (point-min) (point-max))
(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.")
-
(defvar ledger-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [(control ?c) (control ?a)] 'ledger-add-transaction)
@@ -321,18 +313,6 @@ With a prefix argument, remove the effective date. "
(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)
-
- (if (boundp 'font-lock-defaults)
- (set (make-local-variable 'font-lock-defaults)
- '(ledger-font-lock-keywords nil t)))
- (setq font-lock-extend-region-functions
- (list #'font-lock-extend-region-wholelines))
- (setq font-lock-multiline nil)
-
(set (make-local-variable 'pcomplete-parse-arguments-function)
'ledger-parse-arguments)
(set (make-local-variable 'pcomplete-command-completion-function)
@@ -340,13 +320,17 @@ With a prefix argument, remove the effective date. "
(add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t)
(add-hook 'after-save-hook 'ledger-report-redo)
+ (ledger-fontify-whole-buffer)
+ (ledger-fontify-activate)
+
;(add-hook 'after-save-hook)
(add-hook 'post-command-hook 'ledger-highlight-xact-under-point nil t)
(add-hook 'before-revert-hook 'ledger-occur-remove-all-overlays nil t)
(ledger-init-load-init-file)
- (set (make-local-variable 'indent-region-function) 'ledger-post-align-postings))
+ (set (make-local-variable 'indent-region-function) 'ledger-post-align-postings)
+ (run-mode-hooks))
(defun ledger-set-year (newyear)