diff options
author | Case Duckworth | 2021-09-28 19:52:09 -0500 |
---|---|---|
committer | Case Duckworth | 2021-09-28 19:52:09 -0500 |
commit | 2c825439737beb4da049a2f3f0b20d85a2e931d1 (patch) | |
tree | 8a8f4645eaa0cafde8af7079307da3cc80aa59c7 | |
parent | Recipes (diff) | |
download | emacs-2c825439737beb4da049a2f3f0b20d85a2e931d1.tar.gz emacs-2c825439737beb4da049a2f3f0b20d85a2e931d1.zip |
Rewrite with-eval-after-loads
-rw-r--r-- | lisp/acdw.el | 16 |
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. |
85 | This macro simplifies `with-eval-after-load' for multiple nested | 85 | This macro simplifies `with-eval-after-load' for multiple nested |
86 | features." | 86 | features." |
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." |