docs: update modulep! docstring

To clarify, reflect recent changes, and link to `doom!` for details.
This commit is contained in:
Henrik Lissner 2022-09-15 23:29:37 +02:00
parent 20ab9154c2
commit a9e0156416
No known key found for this signature in database
GPG Key ID: B60957CA074D39A3

View File

@ -508,19 +508,18 @@ WARNINGS:
(define-obsolete-function-alias 'featurep! 'modulep! "3.0.0")
(defmacro modulep! (category &optional module flag)
"Return t if FEATURES are all present.
"Return t if :CATEGORY MODULE (and +FLAGS) are enabled.
If FLAG is provided, returns t if CATEGORY MODULE has FLAG enabled.
(modulep! :config default)
(modulep! :config default +flag)
Module FLAGs are set in your config's `doom!' block, typically in
~/.doom.d/init.el. Like so:
CATEGORY and MODULE may be omitted when this macro is used from a Doom module's
source (except your DOOMDIR, which is a special module). Like so:
:config (default +flag1 -flag2)
(modulep! +flag)
CATEGORY and MODULE can be omitted When this macro is used from inside a module
(except your DOOMDIR, which is a special module). e.g. (modulep! +flag)"
For more about modules and flags, see `doom!'."
(and (cond (flag (memq flag (cdr (get category module))))
(module (get category module))
(doom--current-flags (memq category doom--current-flags))