Reset more state on doom/module initialization
Makes `doom/reload` a little more reliable and the side effects of `doom-initialize`/`doom-initialize-modules` a little more deterministic.
This commit is contained in:
parent
defd60b24b
commit
31eb845f6b
3 changed files with 22 additions and 5 deletions
|
@ -33,11 +33,11 @@ Runs `doom-reload-hook' afterwards."
|
|||
(when (getenv "DOOMENV")
|
||||
(doom-reload-env-file 'force))
|
||||
(doom-reload-autoloads force-p)
|
||||
(setq load-path doom-site-load-path)
|
||||
(let (doom-init-p)
|
||||
(doom-initialize))
|
||||
(with-demoted-errors "PRIVATE CONFIG ERROR: %s"
|
||||
(doom-initialize-modules 'force))
|
||||
(let (doom-init-modules-p)
|
||||
(doom-initialize-modules)))
|
||||
(when (bound-and-true-p doom-packages)
|
||||
(doom/reload-packages))
|
||||
(run-hook-wrapped 'doom-reload-hook #'doom-try-run-hook))
|
||||
|
|
|
@ -59,6 +59,7 @@ session of Dooming. Will noop if used more than once, unless FORCE-P is
|
|||
non-nil."
|
||||
(when (and (or force-p
|
||||
(not doom-init-modules-p))
|
||||
(not (setq doom-modules nil))
|
||||
(load! "init" doom-private-dir t))
|
||||
(setq doom-init-modules-p t)
|
||||
(maphash (lambda (key plist)
|
||||
|
|
22
core/core.el
22
core/core.el
|
@ -98,11 +98,21 @@ MacOS users).")
|
|||
"If non-nil, the running version of Emacs is different from the first time
|
||||
Doom was setup, which can cause problems.")
|
||||
|
||||
(defvar doom-site-load-path load-path
|
||||
"The starting `load-path', before it is altered by `doom-initialize'.")
|
||||
(defvar doom-site-load-path (cons doom-core-dir load-path)
|
||||
"The initial value of `load-path', before it was altered by
|
||||
`doom-initialize'.")
|
||||
|
||||
(defvar doom-site-process-environment process-environment
|
||||
"The starting `process-environment', before it is altered by `doom-initialize'.")
|
||||
"The initial value of `process-environment', before it was altered by
|
||||
`doom-initialize'.")
|
||||
|
||||
(defvar doom-site-exec-path exec-path
|
||||
"The initial value of `exec-path', before it was altered by
|
||||
`doom-initialize'.")
|
||||
|
||||
(defvar doom-site-shell-file-name shell-file-name
|
||||
"The initial value of `shell-file-name', before it was altered by
|
||||
`doom-initialize'.")
|
||||
|
||||
(defvar doom--last-emacs-file (concat doom-local-dir "emacs-version.el"))
|
||||
(defvar doom--last-emacs-version nil)
|
||||
|
@ -431,6 +441,12 @@ to least)."
|
|||
(when (or force-p (not doom-init-p))
|
||||
(setq doom-init-p t) ; Prevent infinite recursion
|
||||
|
||||
;; Reset as much state as possible
|
||||
(setq exec-path doom-site-exec-path
|
||||
load-path doom-site-load-path
|
||||
process-environment doom-site-process-environment
|
||||
shell-file-name doom-site-shell-file-name)
|
||||
|
||||
;; `doom-autoload-file' tells Emacs where to load all its autoloaded
|
||||
;; functions from. This includes everything in core/autoload/*.el and all
|
||||
;; the autoload files in your enabled modules.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue