From 71a8c6f7676349af7258ae027e89bf8b35c794b9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 19 Jun 2015 16:09:41 +0200 Subject: [PATCH] Auto-compile elisp files & delete trailing whitespaces --- modules/module-elisp.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/module-elisp.el b/modules/module-elisp.el index 660cc4df0..a52179743 100644 --- a/modules/module-elisp.el +++ b/modules/module-elisp.el @@ -7,6 +7,14 @@ (defadvice emacs-lisp-mode (after emacs-lisp-mode-rename-modeline activate) (setq mode-name "Elisp")) +(defun narf-elisp-auto-compile () + (when (narf/is-compilable-p) + (narf:compile-el))) + +(add-hook! emacs-lisp-mode + (add-hook 'before-save-hook 'delete-trailing-whitespace nil t) + (add-hook 'after-save-hook 'narf-elisp-auto-compile nil t)) + ;; Real go-to-definition for elisp (bind! :map emacs-lisp-mode-map :m "gd" 'narf/elisp-find-function-at-pt