about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lisp/acdw.el16
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 4043134..86443a1 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -80,12 +80,20 @@ When not specified, ELLIPSIS defaults to '...'."
80 ,@forms)) 80 ,@forms))
81 (add-function :after after-focus-change-function #',func-name)))) 81 (add-function :after after-focus-change-function #',func-name))))
82 82
83(defmacro with-eval-after-loads (files &rest body) 83(defmacro with-eval-after-loads (features &rest body)
84 "Execute BODY after FILES are loaded. 84 "Execute BODY after FEATURES are loaded.
85This macro simplifies `with-eval-after-load' for multiple nested 85This macro simplifies `with-eval-after-load' for multiple nested
86features." 86features."
87 (declare (indent 1) (debug (form def-body))) 87 (declare (indent 1)
88 (waterfall-list 'with-eval-after-load files body)) 88 (debug (form def-body)))
89 (unless (listp features)
90 (setq features (list features)))
91 (if (null features)
92 (macroexp-progn body)
93 (let* ((this (car features))
94 (rest (cdr features)))
95 `(with-eval-after-load ',this
96 (with-eval-after-all ,rest ,@body)))))
89 97
90(defmacro with-message (message &rest body) 98(defmacro with-message (message &rest body)
91 "Execute BODY, messaging 'MESSAGE...' before and 'MESSAGE... Done.' after." 99 "Execute BODY, messaging 'MESSAGE...' before and 'MESSAGE... Done.' after."