Fix a pre-init race condition caused by doom-initialize-packages
This commit is contained in:
parent
adf724a6e4
commit
fa69e25f87
2 changed files with 14 additions and 9 deletions
|
@ -134,6 +134,17 @@ missing) and shouldn't be deleted.")
|
||||||
;; Bootstrap API
|
;; Bootstrap API
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(defun doom--refresh-cache ()
|
||||||
|
"TODO"
|
||||||
|
(doom-initialize-packages 'internal)
|
||||||
|
(unless noninteractive
|
||||||
|
(with-temp-buffer
|
||||||
|
(prin1 `(setq load-path ',load-path
|
||||||
|
Info-directory-list ',Info-directory-list
|
||||||
|
doom-disabled-packages ',doom-disabled-packages)
|
||||||
|
(current-buffer))
|
||||||
|
(write-file doom-packages-file))))
|
||||||
|
|
||||||
(defun doom-initialize (&optional force-p)
|
(defun doom-initialize (&optional force-p)
|
||||||
"Bootstrap the bare essentials to get Doom running, if it hasn't already. If
|
"Bootstrap the bare essentials to get Doom running, if it hasn't already. If
|
||||||
FORCE-P is non-nil, do it anyway.
|
FORCE-P is non-nil, do it anyway.
|
||||||
|
@ -181,14 +192,7 @@ FORCE-P is non-nil, do it anyway.
|
||||||
(error "✕ Couldn't install %s" package)))
|
(error "✕ Couldn't install %s" package)))
|
||||||
(message "Installing core packages...done")))
|
(message "Installing core packages...done")))
|
||||||
(cl-pushnew doom-core-dir load-path :test #'string=)
|
(cl-pushnew doom-core-dir load-path :test #'string=)
|
||||||
(doom-initialize-packages 'internal)
|
(add-hook 'doom-init-core-hook #'doom--refresh-cache))
|
||||||
(unless noninteractive
|
|
||||||
(with-temp-buffer
|
|
||||||
(prin1 `(setq load-path ',load-path
|
|
||||||
Info-directory-list ',Info-directory-list
|
|
||||||
doom-disabled-packages ',doom-disabled-packages)
|
|
||||||
(current-buffer))
|
|
||||||
(write-file doom-packages-file))))
|
|
||||||
(setq doom-init-p t)))
|
(setq doom-init-p t)))
|
||||||
|
|
||||||
(defun doom-initialize-autoloads ()
|
(defun doom-initialize-autoloads ()
|
||||||
|
|
|
@ -159,12 +159,13 @@ ability to invoke the debugger in debug mode."
|
||||||
(load! core-projects) ; making Emacs project-aware
|
(load! core-projects) ; making Emacs project-aware
|
||||||
(load! core-keybinds)) ; centralized keybind system + which-key
|
(load! core-keybinds)) ; centralized keybind system + which-key
|
||||||
|
|
||||||
|
(run-hooks 'doom-init-core-hook)
|
||||||
|
|
||||||
(defun doom|after-init ()
|
(defun doom|after-init ()
|
||||||
"Run `doom-init-hook' and `doom-post-init-hook', start the Emacs server, and
|
"Run `doom-init-hook' and `doom-post-init-hook', start the Emacs server, and
|
||||||
display the loading benchmark."
|
display the loading benchmark."
|
||||||
(dolist (hook '(doom-init-hook doom-post-init-hook))
|
(dolist (hook '(doom-init-hook doom-post-init-hook))
|
||||||
(run-hook-wrapped hook #'doom-try-run-hook hook))
|
(run-hook-wrapped hook #'doom-try-run-hook hook))
|
||||||
(run-hooks 'doom-finalize-hook)
|
|
||||||
(unless noninteractive
|
(unless noninteractive
|
||||||
(when (display-graphic-p)
|
(when (display-graphic-p)
|
||||||
(require 'server)
|
(require 'server)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue