mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add FLAG argument to doom-module-p
This commit is contained in:
@ -104,12 +104,15 @@ non-nil."
|
||||
;;
|
||||
;;; 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')."
|
||||
(declare (pure t) (side-effect-free t))
|
||||
(and (hash-table-p doom-modules)
|
||||
(gethash (cons category module) doom-modules)
|
||||
t))
|
||||
(when (hash-table-p doom-modules)
|
||||
(let ((plist (gethash (cons category module) doom-modules)))
|
||||
(and plist
|
||||
(or (null flag)
|
||||
(memq flag (plist-get plist :flags)))
|
||||
t))))
|
||||
|
||||
(defun doom-module-get (category module &optional property)
|
||||
"Returns the plist for CATEGORY MODULE. Gets PROPERTY, specifically, if set."
|
||||
|
Reference in New Issue
Block a user