Add FLAG argument to doom-module-p
This commit is contained in:
parent
ebd53e5664
commit
faeefc1775
1 changed files with 7 additions and 4 deletions
|
@ -104,12 +104,15 @@ non-nil."
|
||||||
;;
|
;;
|
||||||
;;; Module API
|
;;; Module API
|
||||||
|
|
||||||
(defun doom-module-p (category module)
|
(defun doom-module-p (category module &optional flag)
|
||||||
"Returns t if CATEGORY MODULE is enabled (ie. present in `doom-modules')."
|
"Returns t if CATEGORY MODULE is enabled (ie. present in `doom-modules')."
|
||||||
(declare (pure t) (side-effect-free t))
|
(declare (pure t) (side-effect-free t))
|
||||||
(and (hash-table-p doom-modules)
|
(when (hash-table-p doom-modules)
|
||||||
(gethash (cons category module) doom-modules)
|
(let ((plist (gethash (cons category module) doom-modules)))
|
||||||
t))
|
(and plist
|
||||||
|
(or (null flag)
|
||||||
|
(memq flag (plist-get plist :flags)))
|
||||||
|
t))))
|
||||||
|
|
||||||
(defun doom-module-get (category module &optional property)
|
(defun doom-module-get (category module &optional property)
|
||||||
"Returns the plist for CATEGORY MODULE. Gets PROPERTY, specifically, if set."
|
"Returns the plist for CATEGORY MODULE. Gets PROPERTY, specifically, if set."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue