fix: premature doom init in doom sub-profiles
Ensures that Doom doesn't prematurely initialize itself if a non-Doom config tries to load Doom.
This commit is contained in:
parent
2d53fe6123
commit
3a5e34d67b
1 changed files with 33 additions and 31 deletions
|
@ -132,8 +132,11 @@
|
|||
;;
|
||||
;;; Bootstrap
|
||||
|
||||
(let (init-file)
|
||||
;; Load the heart of Doom Emacs
|
||||
(unless (require 'doom (expand-file-name "lisp/doom" user-emacs-directory) t)
|
||||
(if (require 'doom (expand-file-name "lisp/doom" user-emacs-directory) t)
|
||||
;; ...and prepare for an interactive session.
|
||||
(setq init-file (expand-file-name "doom-start" doom-core-dir))
|
||||
;; ...but if that fails, then this is likely not a Doom config.
|
||||
(setq early-init-file (expand-file-name "early-init" user-emacs-directory))
|
||||
(load early-init-file t (not init-file-debug)))
|
||||
|
@ -157,12 +160,11 @@
|
|||
(define-advice startup--load-user-init-file (:filter-args (args) init-doom)
|
||||
"Initialize Doom Emacs in an interactive session."
|
||||
(list (lambda ()
|
||||
(if (boundp 'doom-core-dir)
|
||||
(expand-file-name "doom-start" doom-core-dir)
|
||||
(or init-file
|
||||
(expand-file-name "init.el" user-emacs-directory)))
|
||||
(when (boundp 'doom-profiles-dir)
|
||||
(lambda ()
|
||||
(expand-file-name "safe-mode@static/init.el" doom-profiles-dir)))
|
||||
(caddr args)))
|
||||
(caddr args))))
|
||||
|
||||
;;; early-init.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue