Refactor after! macro
KISS
This commit is contained in:
parent
5a7c8803d9
commit
07d37f97fb
1 changed files with 12 additions and 15 deletions
|
@ -253,21 +253,18 @@ compilation. This will no-op on features that have been disabled by the user."
|
||||||
(load next :no-message :no-error)))))
|
(load next :no-message :no-error)))))
|
||||||
#'progn
|
#'progn
|
||||||
#'with-no-warnings)
|
#'with-no-warnings)
|
||||||
(cond ((symbolp targets)
|
(if (symbolp targets)
|
||||||
`(with-eval-after-load ',targets
|
`(with-eval-after-load ',targets ,@body)
|
||||||
,@body))
|
(pcase (car-safe targets)
|
||||||
((and (consp targets)
|
((or :or :any)
|
||||||
(memq (car targets) '(:or :any)))
|
(macroexp-progn
|
||||||
`(progn
|
(cl-loop for next in (cdr targets)
|
||||||
,@(cl-loop for next in (cdr targets)
|
collect `(after! ,next ,@body))))
|
||||||
collect `(after! ,next ,@body))))
|
((or :and :all)
|
||||||
((and (consp targets)
|
(dolist (next (cdr targets))
|
||||||
(memq (car targets) '(:and :all)))
|
(setq body `((after! ,next ,@body))))
|
||||||
(dolist (next (cdr targets))
|
(car body))
|
||||||
(setq body `((after! ,next ,@body))))
|
(_ `(after! (:and ,@targets) ,@body)))))))
|
||||||
(car body))
|
|
||||||
((listp targets)
|
|
||||||
`(after! (:all ,@targets) ,@body))))))
|
|
||||||
|
|
||||||
(defmacro quiet! (&rest forms)
|
(defmacro quiet! (&rest forms)
|
||||||
"Run FORMS without making any output."
|
"Run FORMS without making any output."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue