mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-13 13:13:35 -05:00
refactor: introduce doom-module-context
Wheref9201eb
introduced a general context system, this one introduces one for modules, to simplify our let-bind game when interacting with modules, and to more efficiently expose module state to modulep! (which gets called at runtime a great deal, so its performance is important). * lisp/doom-lib.el (doom-log): simplify macro and introduce doom-inhibit-log variable. * lisp/doom-modules.el (modulep!): fix reported file path if modulep! fails to find the local module. * lisp/lib/debug.el (doom-debug-variables): disable doom-inhibit-log when debug mode is on. Ref:f9201eb218
This commit is contained in:
@@ -399,9 +399,9 @@ Defaults to the profile at `doom-profile-default'."
|
||||
(init-file doom-module-init-file)
|
||||
(config-file doom-module-config-file))
|
||||
(letf! ((defun module-loader (group name file &optional noerror)
|
||||
`(let ((doom--current-module '(,group . ,name))
|
||||
(doom--current-flags ',(doom-module-get group name :flags)))
|
||||
(doom-load ,(abbreviate-file-name (file-name-sans-extension file)))))
|
||||
(doom-module-context-with (cons group name)
|
||||
`(let ((doom-module-context ,doom-module-context))
|
||||
(doom-load ,(abbreviate-file-name (file-name-sans-extension file))))))
|
||||
(defun module-list-loader (modules file &optional noerror)
|
||||
(cl-loop for (cat . mod) in modules
|
||||
if (doom-module-locate-path cat mod file)
|
||||
|
Reference in New Issue
Block a user