refactor: deprecate doom-etc-dir for doom-data-dir

doom-etc-dir will be renamed to doom-data-dir, to better reflect its
purpose, and align it with XDG_DATA_HOME (where it will be moved to in
v3, where Doom will begin to obey XDG directory conventions more
closely).
This commit is contained in:
Henrik Lissner 2022-08-14 18:10:01 +02:00
parent a5c80fcb4b
commit aa54383b5d
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
28 changed files with 42 additions and 41 deletions

View file

@ -108,7 +108,7 @@
;; Create all our core directories to quell file errors.
(mapc (doom-rpartial #'make-directory 'parents)
(list doom-local-dir
doom-etc-dir
doom-data-dir
doom-cache-dir))
;; Load standard :help and :version handlers.

View file

@ -291,7 +291,7 @@ tell you about it. Very annoying. This prevents that."
;;;###package bookmark
(setq bookmark-default-file (concat doom-etc-dir "bookmarks"))
(setq bookmark-default-file (concat doom-data-dir "bookmarks"))
(use-package! recentf

View file

@ -230,9 +230,9 @@ downloaded/installed by packages. Must end in a slash.")
Use this as a storage location for this system's installation of Doom Emacs.
These files should not be shared across systems. By default, it is used by
`doom-etc-dir' and `doom-cache-dir'. Must end with a slash.")
`doom-data-dir' and `doom-cache-dir'. Must end with a slash.")
(defconst doom-etc-dir
(defconst doom-data-dir
(if doom-profile
doom-profile-data-dir
(concat doom-local-dir "etc/"))
@ -274,6 +274,7 @@ users).")
;;; Legacy support
(define-obsolete-variable-alias 'doom-private-dir 'doom-user-dir "3.0.0")
(define-obsolete-variable-alias 'doom-etc-dir 'doom-data-dir "3.0.0")
(make-obsolete-variable 'EMACS28+ "Use (>= emacs-major-version 28) instead" "3.0.0")
(make-obsolete-variable 'EMACS29+ "Use (>= emacs-major-version 29) instead" "3.0.0")
@ -351,7 +352,7 @@ users).")
;; By default, Emacs stores `authinfo' in $HOME and in plain-text. Let's not do
;; that, mkay? This file stores usernames, passwords, and other treasures for
;; the aspiring malicious third party. You'll need a GPG setup though.
(setq auth-sources (list (concat doom-etc-dir "authinfo.gpg")
(setq auth-sources (list (concat doom-data-dir "authinfo.gpg")
"~/.authinfo.gpg"))
(define-advice en/disable-command (:around (fn &rest args) write-to-data-dir)

View file

@ -63,9 +63,9 @@
(setq init-file-debug t
doom-emacs-dir ,doom-emacs-dir
doom-cache-dir ,(expand-file-name "cache/" doom-sandbox-dir)
doom-etc-dir ,(expand-file-name "etc/" doom-sandbox-dir))
doom-data-dir ,(expand-file-name "data/" doom-sandbox-dir))
(defun doom--write-to-etc-dir-a (fn &rest args)
(let ((user-emacs-directory doom-etc-dir))
(let ((user-emacs-directory doom-data-dir))
(apply fn args)))
(advice-add #'locate-user-emacs-file :around #'doom--write-to-etc-dir-a)
;; emacs essential variables

View file

@ -5,7 +5,7 @@
Will be saved in `doom-scratch-dir'.")
(defvar doom-scratch-dir (concat doom-etc-dir "scratch")
(defvar doom-scratch-dir (concat doom-data-dir "scratch")
"Where to save persistent scratch buffers.")
(defvar doom-scratch-initial-major-mode nil

View file

@ -3,7 +3,7 @@
;; This little library abstracts the process of writing arbitrary elisp values
;; to a 2-tiered file store (in `doom-store-dir'/`doom-store-location').
(defvar doom-store-dir (concat doom-etc-dir "store/")
(defvar doom-store-dir (concat doom-data-dir "store/")
"Directory to look for and store data accessed through this API.")
(defvar doom-store-persist-alist ()