diff options
author | Tom Willemse | 2014-06-02 23:52:28 +0200 |
---|---|---|
committer | Tom Willemse | 2014-06-02 23:52:28 +0200 |
commit | 85e350cd54afeb44302f32178a60f4950ef4c858 (patch) | |
tree | 622ed816701b662fa06a957739cb437e6c2a3ca8 /.emacs.d/init.el | |
parent | b0da2bf32612893c28ac4a21aa1e77373fe841d4 (diff) | |
download | emacs-85e350cd54afeb44302f32178a60f4950ef4c858.tar.gz emacs-85e350cd54afeb44302f32178a60f4950ef4c858.zip |
Add auto-init macro
Diffstat (limited to '.emacs.d/init.el')
-rw-r--r-- | .emacs.d/init.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index a0534af..8ee6b79 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -38,6 +38,16 @@ ;;;; Macros +(defmacro auto-init (library) + "Load a file for LIBRARY after loading the library. + +The loaded file should be `LIBRARY-init', either `.el' or `.elc' +will do." + `(with-eval-after-load ',library + (load ,(concat (if (symbolp library) + (symbol-name library) + library) "-init")))) + ;; http://www.lunaryorn.com/2013/06/25/introducing-with-eval-after-load/ (defmacro stante-after (feature &rest forms) "After FEATURE is loaded, evaluate FORMS. |