From 85e350cd54afeb44302f32178a60f4950ef4c858 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 2 Jun 2014 23:52:28 +0200 Subject: Add auto-init macro --- .emacs.d/init.el | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. -- cgit v1.2.3-54-g00ecf