Advise locate-user-emacs-file to use doom-etc-dir
This is commonly used in Emacs packages to resolve to a location in `~/.emacs.d`, as storage or a cache. Rather than addressing each file/directory variable as they are encountered, better to address this at the source. Also: this makes some file/directory settings redundant, so they were removed. Closes #4347
This commit is contained in:
parent
7038c2e800
commit
c517be8e69
1 changed files with 14 additions and 17 deletions
31
core/core.el
31
core/core.el
|
@ -237,11 +237,12 @@ users).")
|
||||||
(setq auth-sources (list (concat doom-etc-dir "authinfo.gpg")
|
(setq auth-sources (list (concat doom-etc-dir "authinfo.gpg")
|
||||||
"~/.authinfo.gpg"))
|
"~/.authinfo.gpg"))
|
||||||
|
|
||||||
;; Don't litter `doom-emacs-dir'. We don't use `no-littering' because it's a
|
|
||||||
;; mote too opinionated for our needs.
|
;;
|
||||||
(setq abbrev-file-name (concat doom-local-dir "abbrev.el")
|
;;; Don't litter `doom-emacs-dir'
|
||||||
async-byte-compile-log-file (concat doom-etc-dir "async-bytecomp.log")
|
|
||||||
bookmark-default-file (concat doom-etc-dir "bookmarks")
|
;; We avoid `no-littering' because it's a mote too opinionated for our needs.
|
||||||
|
(setq async-byte-compile-log-file (concat doom-etc-dir "async-bytecomp.log")
|
||||||
custom-file (concat doom-private-dir "custom.el")
|
custom-file (concat doom-private-dir "custom.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")
|
||||||
|
@ -249,20 +250,16 @@ users).")
|
||||||
desktop-base-lock-name "autosave-lock"
|
desktop-base-lock-name "autosave-lock"
|
||||||
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")
|
||||||
shared-game-score-directory (concat doom-etc-dir "shared-game-score/")
|
shared-game-score-directory (concat doom-etc-dir "shared-game-score/"))
|
||||||
tramp-auto-save-directory (concat doom-cache-dir "tramp-auto-save/")
|
|
||||||
tramp-backup-directory-alist backup-directory-alist
|
|
||||||
tramp-persistency-file-name (concat doom-cache-dir "tramp-persistency.el")
|
|
||||||
url-cache-directory (concat doom-cache-dir "url/")
|
|
||||||
url-configuration-directory (concat doom-etc-dir "url/")
|
|
||||||
gamegrid-user-score-file-directory (concat doom-etc-dir "games/"))
|
|
||||||
|
|
||||||
;; HACK Stop sessions from littering the user directory
|
(defadvice! doom--write-to-etc-dir-a (orig-fn &rest args)
|
||||||
(defadvice! doom--use-cache-dir-a (session-id)
|
"Resolve Emacs storage directory to `doom-etc-dir', to keep local files from
|
||||||
:override #'emacs-session-filename
|
polluting `doom-emacs-dir'."
|
||||||
(concat doom-cache-dir "emacs-session." session-id))
|
:around #'locate-user-emacs-file
|
||||||
|
(let ((user-emacs-directory doom-etc-dir))
|
||||||
|
(apply orig-fn args)))
|
||||||
|
|
||||||
(defadvice! doom--save-enabled-commands-to-doomdir-a (orig-fn &rest args)
|
(defadvice! doom--write-enabled-commands-to-doomdir-a (orig-fn &rest args)
|
||||||
"When enabling a disabled command, the `put' call is written to
|
"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
|
~/.emacs.d/init.el, which causes issues for Doom, so write it to the user's
|
||||||
config.el instead."
|
config.el instead."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue