Make after! noop if package is disabled
After disabling a package, def-package! blocks for that package are ignored. Now, after! blocks for those packages will be ignored too.
This commit is contained in:
parent
f2c02e32c8
commit
16a9126b3e
1 changed files with 23 additions and 21 deletions
|
@ -108,27 +108,29 @@
|
|||
"A smart wrapper around `with-eval-after-load'. Supresses warnings during
|
||||
compilation."
|
||||
(declare (indent defun) (debug t))
|
||||
(list (if (or (not (bound-and-true-p byte-compile-current-file))
|
||||
(dolist (next (doom-enlist targets))
|
||||
(if (symbolp next)
|
||||
(require next nil :no-error)
|
||||
(load next :no-message :no-error))))
|
||||
#'progn
|
||||
#'with-no-warnings)
|
||||
(cond ((symbolp targets)
|
||||
`(eval-after-load ',targets '(progn ,@body)))
|
||||
((and (consp targets)
|
||||
(memq (car targets) '(:or :any)))
|
||||
`(progn
|
||||
,@(cl-loop for next in (cdr targets)
|
||||
collect `(after! ,next ,@body))))
|
||||
((and (consp targets)
|
||||
(memq (car targets) '(:and :all)))
|
||||
(dolist (next (cdr targets))
|
||||
(setq body `(after! ,next ,@body)))
|
||||
body)
|
||||
((listp targets)
|
||||
`(after! (:all ,@targets) ,@body)))))
|
||||
(unless (and (symbolp targets)
|
||||
(memq targets doom-disabled-packages))
|
||||
(list (if (or (not (bound-and-true-p byte-compile-current-file))
|
||||
(dolist (next (doom-enlist targets))
|
||||
(if (symbolp next)
|
||||
(require next nil :no-error)
|
||||
(load next :no-message :no-error))))
|
||||
#'progn
|
||||
#'with-no-warnings)
|
||||
(cond ((symbolp targets)
|
||||
`(eval-after-load ',targets '(progn ,@body)))
|
||||
((and (consp targets)
|
||||
(memq (car targets) '(:or :any)))
|
||||
`(progn
|
||||
,@(cl-loop for next in (cdr targets)
|
||||
collect `(after! ,next ,@body))))
|
||||
((and (consp targets)
|
||||
(memq (car targets) '(:and :all)))
|
||||
(dolist (next (cdr targets))
|
||||
(setq body `(after! ,next ,@body)))
|
||||
body)
|
||||
((listp targets)
|
||||
`(after! (:all ,@targets) ,@body))))))
|
||||
|
||||
(defmacro quiet! (&rest forms)
|
||||
"Run FORMS without making any output."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue