custom-file = ~/.doom.d/config.el

custom-file is now set to your private config.el, because users may want
to be able to see what Customize is storing (and where) front and
center. Storing it away in ~/.emacs.d/.local makes it harder to notice.

Also, have enable-command (and disable-command) save their data to
custom-file instead of ~/.emacs.d (see #3379).

Fixes #3379
This commit is contained in:
Henrik Lissner 2020-06-13 16:09:26 -04:00
parent 0f3bd57101
commit 1d709e30be
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 10 additions and 3 deletions

View file

@ -119,8 +119,7 @@ non-nil."
(unless no-config-p (unless no-config-p
(maphash (doom-module-loader doom-module-config-file) doom-modules) (maphash (doom-module-loader doom-module-config-file) doom-modules)
(run-hook-wrapped 'doom-init-modules-hook #'doom-try-run-hook) (run-hook-wrapped 'doom-init-modules-hook #'doom-try-run-hook)
(load! "config" doom-private-dir t) (load! "config" doom-private-dir t)))))
(load custom-file 'noerror (not doom-debug-mode))))))
;; ;;

View file

@ -233,7 +233,7 @@ users).")
(setq abbrev-file-name (concat doom-local-dir "abbrev.el") (setq abbrev-file-name (concat doom-local-dir "abbrev.el")
async-byte-compile-log-file (concat doom-etc-dir "async-bytecomp.log") async-byte-compile-log-file (concat doom-etc-dir "async-bytecomp.log")
bookmark-default-file (concat doom-etc-dir "bookmarks") bookmark-default-file (concat doom-etc-dir "bookmarks")
custom-file (concat doom-local-dir "custom.el") custom-file (concat doom-private-dir "config.el")
custom-theme-directory (concat doom-private-dir "themes/") custom-theme-directory (concat doom-private-dir "themes/")
desktop-dirname (concat doom-etc-dir "desktop") desktop-dirname (concat doom-etc-dir "desktop")
desktop-base-file-name "autosave" desktop-base-file-name "autosave"
@ -253,6 +253,14 @@ users).")
:override #'emacs-session-filename :override #'emacs-session-filename
(concat doom-cache-dir "emacs-session." session-id)) (concat doom-cache-dir "emacs-session." session-id))
(defadvice! doom--save-enabled-commands-to-doomdir-a (orig-fn &rest args)
"When enabling a disabled command, the `put' call is written to
~/.emacs.d/init.el, which causes issues for Doom, so write it to the user's
config.el instead."
:around #'en/disable-command
(let ((user-init-file custom-file))
(apply orig-fn args)))
;; ;;
;;; Optimizations ;;; Optimizations