fix: ensure module state is in scope for modulep!
Otherwise, doom-module-from-path (and modulep!) would fail to detect the module they're in, or at least, modulep! would incorrectly return nil, even for enabled modules. This issue is what would've caused the package list or the doctor to include/consider packages in disabled modules or behind disabled flags.
This commit is contained in:
parent
ce0e3a04b6
commit
45a66cda60
3 changed files with 14 additions and 7 deletions
|
@ -247,7 +247,9 @@ in."
|
||||||
(let (doom-doctor--errors
|
(let (doom-doctor--errors
|
||||||
doom-doctor--warnings)
|
doom-doctor--warnings)
|
||||||
(condition-case-unless-debug ex
|
(condition-case-unless-debug ex
|
||||||
(let ((doctor-file (doom-module-path (car key) (cdr key) "doctor.el"))
|
(let ((doom--current-module key)
|
||||||
|
(doom--current-flags (plist-get plist :flags))
|
||||||
|
(doctor-file (doom-module-path (car key) (cdr key) "doctor.el"))
|
||||||
(packages-file (doom-module-path (car key) (cdr key) "packages.el")))
|
(packages-file (doom-module-path (car key) (cdr key) "packages.el")))
|
||||||
(cl-loop with doom-output-indent = 6
|
(cl-loop with doom-output-indent = 6
|
||||||
for name in (let (doom-packages
|
for name in (let (doom-packages
|
||||||
|
|
|
@ -463,9 +463,11 @@ ones."
|
||||||
(let (doom-packages)
|
(let (doom-packages)
|
||||||
(doom--read-packages private-packages nil 'noerror))
|
(doom--read-packages private-packages nil 'noerror))
|
||||||
(cl-loop for key being the hash-keys of doom-modules
|
(cl-loop for key being the hash-keys of doom-modules
|
||||||
for path = (doom-module-path (car key) (cdr key) packages-file)
|
for plist = (get (car key) (cdr key))
|
||||||
|
for doom--current-flags = (plist-get plist :flags)
|
||||||
for doom--current-module = key
|
for doom--current-module = key
|
||||||
do (doom--read-packages path nil 'noerror)))
|
for file = (doom-path (plist-get plist :path) packages-file)
|
||||||
|
do (doom--read-packages file nil 'noerror)))
|
||||||
(doom--read-packages private-packages all-p 'noerror)))
|
(doom--read-packages private-packages all-p 'noerror)))
|
||||||
(cl-remove-if-not
|
(cl-remove-if-not
|
||||||
(if core-only-p
|
(if core-only-p
|
||||||
|
@ -555,13 +557,14 @@ elsewhere."
|
||||||
`(let* ((name ',name)
|
`(let* ((name ',name)
|
||||||
(plist (cdr (assq name doom-packages))))
|
(plist (cdr (assq name doom-packages))))
|
||||||
;; Record what module this declaration was found in
|
;; Record what module this declaration was found in
|
||||||
(let ((module-list (plist-get plist :modules))
|
(let* ((dir (dir!))
|
||||||
(module ',(doom-module-from-path)))
|
(module-list (plist-get plist :modules))
|
||||||
|
(module (doom-module-from-path dir)))
|
||||||
(unless (member module module-list)
|
(unless (member module module-list)
|
||||||
(cl-callf plist-put plist :modules
|
(cl-callf plist-put plist :modules
|
||||||
(append module-list
|
(append module-list
|
||||||
(list module)
|
(list module)
|
||||||
(when (file-in-directory-p ,(dir!) doom-user-dir)
|
(when (file-in-directory-p dir doom-user-dir)
|
||||||
'((:user . modules)))
|
'((:user . modules)))
|
||||||
nil))))
|
nil))))
|
||||||
;; Merge given plist with pre-existing one
|
;; Merge given plist with pre-existing one
|
||||||
|
|
|
@ -156,7 +156,9 @@ return NULL-VALUE."
|
||||||
(insert-file-contents file nil 0 256)
|
(insert-file-contents file nil 0 256)
|
||||||
(if (re-search-forward (format "^;;;###%s " (regexp-quote (or cookie "if")))
|
(if (re-search-forward (format "^;;;###%s " (regexp-quote (or cookie "if")))
|
||||||
nil t)
|
nil t)
|
||||||
(let ((load-file-name file))
|
(let* ((load-file-name file)
|
||||||
|
(doom--current-module (doom-module-from-path file))
|
||||||
|
(doom--current-flags (doom-module-get (car doom--current-module) (cdr doom--current-module) :flags)))
|
||||||
(eval (sexp-at-point) t))
|
(eval (sexp-at-point) t))
|
||||||
null-value)))
|
null-value)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue