fix: more void-variable errors

For `straight--build-cache` and `doom-modules`.

Fix: #8140
Amend: 8cafbe4408
This commit is contained in:
Henrik Lissner
2024-11-03 12:32:38 -05:00
parent aab1595011
commit f425f2ff3d
4 changed files with 29 additions and 23 deletions

View File

@ -237,7 +237,9 @@ in."
(print! (start "Checking Doom Emacs..."))
(condition-case-unless-debug ex
(print-group!
(require 'doom-start)
(doom-initialize t)
(doom-startup)
(require 'straight)
(print! (success "Initialized Doom Emacs %s") doom-version)
(print!

View File

@ -320,15 +320,7 @@ If RETURN-P, return the message as a string instead of displaying it."
(setq load-history
(delete (assoc init-file-name load-history)
load-history))
(let ((startup-or-reload?
(or (doom-context-p 'startup)
(doom-context-p 'reload))))
(when startup-or-reload?
(doom--startup-vars))
(doom--startup-module-autoloads)
(doom--startup-package-autoloads)
(when startup-or-reload?
(doom--startup-modules)))))
(doom-startup)))
;; TODO: Add safe-mode profile.
;; (error
;; ;; HACK: This is not really this variable's intended purpose, but it

View File

@ -704,7 +704,8 @@ of 'doom sync' or 'doom gc'."
;; DEPRECATED: Interactive sessions won't be able to interact with Straight (or
;; Elpaca) in the future, so this is temporary.
(with-eval-after-load 'straight
(require 'doom-straight))
(require 'doom-straight)
(doom-initialize-packages))
;;

View File

@ -289,7 +289,17 @@ caches them in `doom--profiles'. If RELOAD? is non-nil, refresh the cache."
(dolist (file (doom-glob init-dir "*.el"))
(print-group! :level 'info
(print! (start "Reading %s...") file))
(doom-file-read file :by 'insert)))
(doom-file-read file :by 'insert))
(prin1 `(defun doom-startup ()
(let ((startup-or-reload?
(or (doom-context-p 'startup)
(doom-context-p 'reload))))
(when startup-or-reload?
(doom--startup-vars)
(doom--startup-module-autoloads)
(doom--startup-package-autoloads)
(doom--startup-modules))))
(current-buffer)))
(print! (start "Byte-compiling %s...") (relpath init-file))
(print-group!
(let ((byte-compile-warnings (if init-file-debug '(suspicious make-local callargs))))
@ -358,18 +368,19 @@ caches them in `doom--profiles'. If RELOAD? is non-nil, refresh the cache."
if (doom-module-locate-path key file)
collect (module-loader key it))))
;; FIX: Same as above (see `doom-profile--generate-init-vars').
`((defun doom--startup-modules ()
`((set 'doom-modules ',doom-modules)
(set 'doom-disabled-packages ',doom-disabled-packages)
;; Cache module state and flags in symbol plists for quick lookup by
;; `modulep!' later.
,@(cl-loop
for (category . modules) in (seq-group-by #'car config-modules-list)
collect
`(setplist ',category
(quote ,(cl-loop for (_ . module) in modules
nconc `(,module ,(doom-module->context (cons category module)))))))
(defun doom--startup-modules ()
(with-doom-context 'module
(set 'doom-modules ',doom-modules)
(set 'doom-disabled-packages ',doom-disabled-packages)
;; Cache module state and flags in symbol plists for quick lookup
;; by `modulep!' later.
,@(cl-loop
for (category . modules) in (seq-group-by #'car config-modules-list)
collect
`(setplist ',category
(quote ,(cl-loop for (_ . module) in modules
nconc `(,module ,(doom-module->context (cons category module)))))))
(let ((old-custom-file custom-file))
(with-doom-context 'init
,@(module-list-loader pre-init-modules init-file)