after!: don't shadow features var
This commit is contained in:
parent
65245bfc21
commit
035353d295
1 changed files with 12 additions and 12 deletions
|
@ -55,31 +55,31 @@
|
||||||
|
|
||||||
(defalias 'lambda! 'λ!)
|
(defalias 'lambda! 'λ!)
|
||||||
|
|
||||||
(defmacro after! (features &rest body)
|
(defmacro after! (targets &rest body)
|
||||||
"A smart wrapper around `with-eval-after-load'. Supresses warnings during
|
"A smart wrapper around `with-eval-after-load'. Supresses warnings during
|
||||||
compilation."
|
compilation."
|
||||||
(declare (indent defun) (debug t))
|
(declare (indent defun) (debug t))
|
||||||
(list (if (or (not (bound-and-true-p byte-compile-current-file))
|
(list (if (or (not (bound-and-true-p byte-compile-current-file))
|
||||||
(dolist (next (doom-enlist features))
|
(dolist (next (doom-enlist targets))
|
||||||
(if (symbolp next)
|
(if (symbolp next)
|
||||||
(require next nil :no-error)
|
(require next nil :no-error)
|
||||||
(load next :no-message :no-error))))
|
(load next :no-message :no-error))))
|
||||||
#'progn
|
#'progn
|
||||||
#'with-no-warnings)
|
#'with-no-warnings)
|
||||||
(cond ((symbolp features)
|
(cond ((symbolp targets)
|
||||||
`(eval-after-load ',features '(progn ,@body)))
|
`(eval-after-load ',targets '(progn ,@body)))
|
||||||
((and (consp features)
|
((and (consp targets)
|
||||||
(memq (car features) '(:or :any)))
|
(memq (car targets) '(:or :any)))
|
||||||
`(progn
|
`(progn
|
||||||
,@(cl-loop for next in (cdr features)
|
,@(cl-loop for next in (cdr targets)
|
||||||
collect `(after! ,next ,@body))))
|
collect `(after! ,next ,@body))))
|
||||||
((and (consp features)
|
((and (consp targets)
|
||||||
(memq (car features) '(:and :all)))
|
(memq (car targets) '(:and :all)))
|
||||||
(dolist (next (cdr features))
|
(dolist (next (cdr targets))
|
||||||
(setq body `(after! ,next ,@body)))
|
(setq body `(after! ,next ,@body)))
|
||||||
body)
|
body)
|
||||||
((listp features)
|
((listp targets)
|
||||||
`(after! (:all ,@features) ,@body)))))
|
`(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