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:
parent
5d2313155c
commit
4efaf6837b
8 changed files with 118 additions and 72 deletions
|
@ -242,23 +242,22 @@ in."
|
|||
(let (doom-doctor--errors
|
||||
doom-doctor--warnings)
|
||||
(condition-case-unless-debug ex
|
||||
(let ((doom--current-module key)
|
||||
(doom--current-flags (plist-get plist :flags))
|
||||
(doctor-file (doom-module-expand-path (car key) (cdr key) "doctor.el"))
|
||||
(packages-file (doom-module-expand-path (car key) (cdr key) doom-module-packages-file)))
|
||||
(cl-loop with doom-output-indent = 6
|
||||
for name in (doom-context-with 'packages
|
||||
(let* (doom-packages
|
||||
doom-disabled-packages)
|
||||
(load packages-file 'noerror 'nomessage)
|
||||
(mapcar #'car doom-packages)))
|
||||
unless (or (doom-package-get name :disable)
|
||||
(eval (doom-package-get name :ignore))
|
||||
(plist-member (doom-package-get name :recipe) :local-repo)
|
||||
(locate-library (symbol-name name))
|
||||
(doom-package-built-in-p name)
|
||||
(doom-package-installed-p name))
|
||||
do (print! (error "Missing emacs package: %S") name)))
|
||||
(doom-module-context-with key
|
||||
(let ((doctor-file (doom-module-expand-path (car key) (cdr key) "doctor.el"))
|
||||
(packages-file (doom-module-expand-path (car key) (cdr key) doom-module-packages-file)))
|
||||
(cl-loop with doom-output-indent = 6
|
||||
for name in (doom-context-with 'packages
|
||||
(let* (doom-packages
|
||||
doom-disabled-packages)
|
||||
(load packages-file 'noerror 'nomessage)
|
||||
(mapcar #'car doom-packages)))
|
||||
unless (or (doom-package-get name :disable)
|
||||
(eval (doom-package-get name :ignore))
|
||||
(plist-member (doom-package-get name :recipe) :local-repo)
|
||||
(locate-library (symbol-name name))
|
||||
(doom-package-built-in-p name)
|
||||
(doom-package-installed-p name))
|
||||
do (print! (error "Missing emacs package: %S") name))))
|
||||
(let ((inhibit-message t))
|
||||
(load doctor-file 'noerror 'nomessage))
|
||||
(file-missing (error! "%s" (error-message-string ex)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue