Update after! docstring

This commit is contained in:
Henrik Lissner 2018-12-22 03:55:32 -05:00
parent 4daa9271a0
commit 674ad9837d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -163,8 +163,32 @@ serve as a predicated alternative to `after!'."
(advice-remove #',mode #',advice-fn)))))) (advice-remove #',mode #',advice-fn))))))
(defmacro after! (targets &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' that:
compilation. This will no-op on features that have been disabled by the user."
1. Suppresses warnings at compile-time
2. No-ops for TARGETS that are disabled by the user (via `package!')
3. Supports compound TARGETS statements (see below)
BODY is evaluated once TARGETS are loaded. TARGETS can either be:
- An unquoted package symbol (the name of a package)
(after! helm ...)
- An unquoted list of package symbols
(after! (magit git-gutter) ...)
- An unquoted, nested list of compound package lists, using :or/:any and/or :and/:all
(after! (:or package-a package-b ...) ...)
(after! (:and package-a package-b ...) ...)
(after! (:and package-a (:or package-b package-c) ...) ...)
Note that:
- :or and :any are equivalent
- :and and :all are equivalent
- If these are omitted, :and is assumed."
(declare (indent defun) (debug t)) (declare (indent defun) (debug t))
(unless (and (symbolp targets) (unless (and (symbolp targets)
(memq targets (bound-and-true-p doom-disabled-packages))) (memq targets (bound-and-true-p doom-disabled-packages)))