From 1d709e30be2e5f59d3e78ff14e01fad66768f859 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 13 Jun 2020 16:09:26 -0400 Subject: [PATCH] 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 --- core/core-modules.el | 3 +-- core/core.el | 10 +++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/core-modules.el b/core/core-modules.el index a88a9dfdd..427001fb6 100644 --- a/core/core-modules.el +++ b/core/core-modules.el @@ -119,8 +119,7 @@ non-nil." (unless no-config-p (maphash (doom-module-loader doom-module-config-file) doom-modules) (run-hook-wrapped 'doom-init-modules-hook #'doom-try-run-hook) - (load! "config" doom-private-dir t) - (load custom-file 'noerror (not doom-debug-mode)))))) + (load! "config" doom-private-dir t))))) ;; diff --git a/core/core.el b/core/core.el index 1f31be6ee..1b7a5e7e9 100644 --- a/core/core.el +++ b/core/core.el @@ -233,7 +233,7 @@ users).") (setq abbrev-file-name (concat doom-local-dir "abbrev.el") async-byte-compile-log-file (concat doom-etc-dir "async-bytecomp.log") 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/") desktop-dirname (concat doom-etc-dir "desktop") desktop-base-file-name "autosave" @@ -253,6 +253,14 @@ users).") :override #'emacs-session-filename (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