diff --git a/core/core-modules.el b/core/core-modules.el index 73d02521f..77415af9e 100644 --- a/core/core-modules.el +++ b/core/core-modules.el @@ -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."