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:
Henrik Lissner 2018-08-25 17:26:57 +02:00
parent 0009c7bebf
commit 631c4004ba
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 4 additions and 2 deletions

View file

@ -56,6 +56,10 @@ non-nil."
(load! "config" (plist-get plist :path) t)))
doom-modules)
(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))))