all repos — nixfiles @ ea5a661aa5249364c6f58fc3f66dcb35104c933e

System and user configuration, managed by nix and home-manager

Emacs: Install and configure ledger-mode
Alan Pearce alan@alanpearce.co.uk
Thu, 09 Apr 2015 13:12:30 +0100
commit

ea5a661aa5249364c6f58fc3f66dcb35104c933e

parent

c1f68b429dfd508b536e3115c18b58ba9065970e

2 files changed, 12 insertions(+), 1 deletions(-)

jump to
M tag-emacs/emacs.d/Casktag-emacs/emacs.d/Cask
@@ -53,6 +53,7 @@ (depends-on "jinja2-mode") (depends-on "jquery-doc")
 (depends-on "js2-mode")
 (depends-on "litable")
+(depends-on "ledger-mode")
 (depends-on "lua-mode")
 (depends-on "magit")
 (depends-on "markdown-mode")
M tag-emacs/emacs.d/init.eltag-emacs/emacs.d/init.el
@@ -231,7 +231,8 @@ (req-package smart-tab   :commands (global-smart-tab-mode)
   :init (global-smart-tab-mode)
   :config (progn
-            (nconc smart-tab-completion-functions-alist '((php-mode . php-complete-function)))
+            (nconc smart-tab-completion-functions-alist '((php-mode . php-complete-function)
+                                                          (ledger-mode . ledger-pcomplete)))
             (diminish 'smart-tab-mode "")))
 
 (req-package company
@@ -791,6 +792,15 @@ (setq nginx-indent-tabs-mode t))) 
 (req-package lua-mode
   :defer t)
+
+(req-package ledger-mode
+  :mode ("\\.ledger\\'" . ledger-mode)
+  :config (progn
+            (defun setup-ledger-mode ()
+              (setq-local indent-tabs-mode nil))
+            (add-hook 'ledger-mode-hook #'setup-ledger-mode)
+            (setq ledger-use-iso-dates t
+                  ledger-post-use-completion-engine 'ido)))
 
 (req-package ruby-mode
   :mode (("\\.rb\\'" . ruby-mode)