fix: $DOOMDIR loading twice and too early

An unintended change snuck into 2c14eff. The :core and :user virtual
modules are no longer stripped from the module list before iterating
through (and loading) them. This meant that Doom would load these two
like regular modules (and first, since these two are always at the start
of the list).

This is harmless for :core, because it has no init.el or config.el, but
:user does! This means $DOOMDIR/{init,config}.el would be loaded
twice (once before all other modules and again afterwards), causing load
order issues (like #6818).

Fix: #6818
Amend: 2c14eff7f1
This commit is contained in:
Henrik Lissner 2022-09-20 12:57:23 +02:00
parent c5de95f722
commit b7b66e6202
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -386,12 +386,11 @@ Defaults to the profile at `doom-profile-default'."
branch ,(if (zerop (car branch)) (cdr branch)))))))) branch ,(if (zerop (car branch)) (cdr branch))))))))
(defun doom-profile--generate-load-modules () (defun doom-profile--generate-load-modules ()
(let ((module-list (doom-module-list))) (let ((module-list (cddr (doom-module-list))))
;; FIX: Same as above (see `doom-profile--generate-init-vars'). ;; FIX: Same as above (see `doom-profile--generate-init-vars').
`((unless doom-init-time `((unless doom-init-time
(set 'doom-disabled-packages ',doom-disabled-packages) (set 'doom-disabled-packages ',doom-disabled-packages)
(set 'doom-modules ',doom-modules) (set 'doom-modules ',doom-modules)
(defvar doom-modules-list ',(cddr module-list))
;; Cache module state and flags in symbol plists for quick lookup by ;; Cache module state and flags in symbol plists for quick lookup by
;; `modulep!' later. ;; `modulep!' later.
,@(cl-loop for (category . modules) in (seq-group-by #'car (doom-module-list)) ,@(cl-loop for (category . modules) in (seq-group-by #'car (doom-module-list))