Load custom-file only once & after user's config
This change facilitates the users that prefer their custom-file somewhere other than doom-local-dir (e.g. in ~/.doom.d/custom.el). This change prevents loading both files during startup. Just change `custom-file` and Doom will load it after your config.el is loaded (but before doom-post-init-hook runs).
This commit is contained in:
parent
0009c7bebf
commit
631c4004ba
2 changed files with 4 additions and 2 deletions
|
@ -56,6 +56,10 @@ non-nil."
|
||||||
(load! "config" (plist-get plist :path) t)))
|
(load! "config" (plist-get plist :path) t)))
|
||||||
doom-modules)
|
doom-modules)
|
||||||
(load! "config" doom-private-dir t)
|
(load! "config" doom-private-dir t)
|
||||||
|
(unless custom-file
|
||||||
|
(setq custom-file (concat doom-local-dir "custom.el")))
|
||||||
|
(when (stringp custom-file)
|
||||||
|
(load custom-file t t t))
|
||||||
(run-hook-wrapped 'doom-post-init-hook #'doom-try-run-hook))))
|
(run-hook-wrapped 'doom-post-init-hook #'doom-try-run-hook))))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,6 @@ Doom was setup, which can cause problems.")
|
||||||
abbrev-file-name (concat doom-local-dir "abbrev.el")
|
abbrev-file-name (concat doom-local-dir "abbrev.el")
|
||||||
auto-save-list-file-name (concat doom-cache-dir "autosave")
|
auto-save-list-file-name (concat doom-cache-dir "autosave")
|
||||||
backup-directory-alist (list (cons "." (concat doom-cache-dir "backup/")))
|
backup-directory-alist (list (cons "." (concat doom-cache-dir "backup/")))
|
||||||
custom-file (concat doom-local-dir "custom.el")
|
|
||||||
mc/list-file (concat doom-etc-dir "mc-lists.el")
|
mc/list-file (concat doom-etc-dir "mc-lists.el")
|
||||||
pcache-directory (concat doom-cache-dir "pcache/")
|
pcache-directory (concat doom-cache-dir "pcache/")
|
||||||
request-storage-directory (concat doom-cache-dir "request")
|
request-storage-directory (concat doom-cache-dir "request")
|
||||||
|
@ -472,7 +471,6 @@ in interactive sessions, nil otherwise (but logs a warning)."
|
||||||
|
|
||||||
(add-to-list 'load-path doom-core-dir)
|
(add-to-list 'load-path doom-core-dir)
|
||||||
|
|
||||||
(load custom-file t t t)
|
|
||||||
(require 'core-lib)
|
(require 'core-lib)
|
||||||
(require 'core-modules)
|
(require 'core-modules)
|
||||||
(when noninteractive
|
(when noninteractive
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue