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:
parent
a5c80fcb4b
commit
aa54383b5d
28 changed files with 42 additions and 41 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ()
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
(use-package! emms
|
||||
:defer t
|
||||
:init
|
||||
(setq emms-directory (concat doom-etc-dir "emms")
|
||||
(setq emms-directory (concat doom-data-dir "emms")
|
||||
emms-cache-file (concat doom-cache-dir "emms"))
|
||||
:config
|
||||
(emms-all)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
:commands twit
|
||||
:config
|
||||
(setq twittering-private-info-file
|
||||
(expand-file-name "twittering-mode.gpg" doom-etc-dir)
|
||||
(expand-file-name "twittering-mode.gpg" doom-data-dir)
|
||||
twittering-use-master-password t
|
||||
twittering-request-confirmation-on-posting t
|
||||
;; twittering-icon-mode t
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
(unless ispell-personal-dictionary
|
||||
(setq ispell-personal-dictionary
|
||||
(expand-file-name (concat "ispell/" ispell-dictionary ".pws")
|
||||
doom-etc-dir)))
|
||||
doom-data-dir)))
|
||||
|
||||
(add-hook! 'text-mode-hook
|
||||
(defun +spell-remove-run-together-switch-for-aspell-h ()
|
||||
|
@ -128,7 +128,7 @@
|
|||
font-lock-variable-name-face)))
|
||||
"Faces in certain major modes that spell-fu will not spellcheck.")
|
||||
|
||||
(setq spell-fu-directory (concat doom-etc-dir "spell-fu"))
|
||||
(setq spell-fu-directory (concat doom-data-dir "spell-fu"))
|
||||
(when (modulep! +everywhere)
|
||||
(add-hook! '(yaml-mode-hook
|
||||
conf-mode-hook
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
|
||||
|
||||
(after! multiple-cursors-core
|
||||
(setq mc/list-file (concat doom-etc-dir "mc-lists.el"))
|
||||
(setq mc/list-file (concat doom-data-dir "mc-lists.el"))
|
||||
|
||||
;; Can't use `mc/cmds-to-run-once' because mc-lists.el overwrites it
|
||||
(add-to-list 'mc--default-cmds-to-run-once 'swiper-mc)
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
hy-mode) . parinfer-rust-mode)
|
||||
:init
|
||||
(setq parinfer-rust-library
|
||||
(concat doom-etc-dir "parinfer-rust/"
|
||||
(concat doom-data-dir "parinfer-rust/"
|
||||
(cond (IS-MAC "parinfer-rust-darwin.so")
|
||||
(IS-LINUX "parinfer-rust-linux.so")
|
||||
(IS-WINDOWS "parinfer-rust-windows.dll")
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
migemo-user-dictionary nil
|
||||
migemo-regex-dictionary nil
|
||||
migemo-coding-system 'utf-8-unix
|
||||
migemo-directory (concat doom-etc-dir "migemo/")
|
||||
migemo-directory (concat doom-data-dir "migemo/")
|
||||
migemo-dictionary "/usr/local/share/migemo/utf-8/migemo-dict")
|
||||
:config
|
||||
(when (executable-find migemo-command)
|
||||
|
|
|
@ -133,7 +133,7 @@ This is ignored by ccls.")
|
|||
;; Only initialize `irony-mode' if the server is available. Otherwise fail
|
||||
;; quietly and gracefully.
|
||||
:hook ((c-mode-local-vars c++-mode-local-vars objc-mode-local-vars) . +cc-init-irony-mode-maybe-h)
|
||||
:preface (setq irony-server-install-prefix (concat doom-etc-dir "irony-server/"))
|
||||
:preface (setq irony-server-install-prefix (concat doom-data-dir "irony-server/"))
|
||||
:config
|
||||
(defun +cc-init-irony-mode-maybe-h ()
|
||||
(if (file-directory-p irony-server-install-prefix)
|
||||
|
@ -188,7 +188,7 @@ This is ignored by ccls.")
|
|||
:unless (modulep! +lsp)
|
||||
;; Only initialize rtags-mode if rtags and rdm are available.
|
||||
:hook ((c-mode-local-vars c++-mode-local-vars objc-mode-local-vars) . +cc-init-rtags-maybe-h)
|
||||
:preface (setq rtags-install-path (concat doom-etc-dir "rtags/"))
|
||||
:preface (setq rtags-install-path (concat doom-data-dir "rtags/"))
|
||||
:config
|
||||
(defun +cc-init-rtags-maybe-h ()
|
||||
"Start an rtags server in c-mode and c++-mode buffers.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
(use-package! lsp-java
|
||||
:after lsp-mode
|
||||
:preface
|
||||
(setq lsp-java-workspace-dir (concat doom-etc-dir "java-workspace"))
|
||||
(setq lsp-java-workspace-dir (concat doom-data-dir "java-workspace"))
|
||||
(add-hook 'java-mode-local-vars-hook #'lsp! 'append)
|
||||
:config
|
||||
(when (modulep! :tools debugger +lsp)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
(use-package! meghanada
|
||||
:hook (java-mode-local-vars . meghanada-mode)
|
||||
:init
|
||||
(setq meghanada-server-install-dir (concat doom-etc-dir "meghanada-server/")
|
||||
(setq meghanada-server-install-dir (concat doom-data-dir "meghanada-server/")
|
||||
meghanada-use-company (modulep! :completion company)
|
||||
meghanada-use-flycheck (modulep! :checkers syntax)
|
||||
meghanada-use-eldoc t
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
(add-hook 'lua-mode-local-vars-hook #'lsp! 'append)
|
||||
|
||||
(when (modulep! :tools lsp +eglot)
|
||||
(defvar +lua-lsp-dir (concat doom-etc-dir "lsp/lua-language-server/")
|
||||
(defvar +lua-lsp-dir (concat doom-data-dir "lsp/lua-language-server/")
|
||||
"Absolute path to the directory of sumneko's lua-language-server.
|
||||
|
||||
This directory MUST contain the 'main.lua' file and be the in-source build of
|
||||
|
|
|
@ -1087,7 +1087,7 @@ between the two."
|
|||
(use-package! org-clock ; built-in
|
||||
:commands org-clock-save
|
||||
:init
|
||||
(setq org-clock-persist-file (concat doom-etc-dir "org-clock-save.el"))
|
||||
(setq org-clock-persist-file (concat doom-data-dir "org-clock-save.el"))
|
||||
(defadvice! +org--clock-load-a (&rest _)
|
||||
"Lazy load org-clock until its commands are used."
|
||||
:before '(org-clock-in
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
(expand-file-name (or org-roam-directory "roam")
|
||||
org-directory)))
|
||||
org-roam-db-location (or org-roam-db-location
|
||||
(concat doom-etc-dir "org-roam.db"))
|
||||
(concat doom-data-dir "org-roam.db"))
|
||||
;; Make org-roam buffer sticky; i.e. don't replace it when opening a
|
||||
;; file with an *-other-window command.
|
||||
org-roam-buffer-window-parameters '((no-delete-other-windows . t))
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
(add-to-list '+php--company-backends #'php-extras-company)
|
||||
:config
|
||||
(setq php-extras-eldoc-functions-file
|
||||
(concat doom-etc-dir "php-extras-eldoc-functions"))
|
||||
(concat doom-data-dir "php-extras-eldoc-functions"))
|
||||
;; Silence warning if `php-extras-eldoc-functions-file' hasn't finished
|
||||
;; generating yet.
|
||||
(defun php-extras-load-eldoc ()
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
(use-package! plantuml-mode
|
||||
:commands plantuml-download-jar
|
||||
:init
|
||||
(setq plantuml-jar-path (concat doom-etc-dir "plantuml.jar")
|
||||
(setq plantuml-jar-path (concat doom-data-dir "plantuml.jar")
|
||||
org-plantuml-jar-path plantuml-jar-path)
|
||||
:config
|
||||
(set-popup-rule! "^\\*PLANTUML" :size 0.4 :select nil :ttl 0)
|
||||
|
|
|
@ -175,7 +175,7 @@
|
|||
(use-package! anaconda-mode
|
||||
:defer t
|
||||
:init
|
||||
(setq anaconda-mode-installation-directory (concat doom-etc-dir "anaconda/")
|
||||
(setq anaconda-mode-installation-directory (concat doom-data-dir "anaconda/")
|
||||
anaconda-mode-eldoc-as-single-line t)
|
||||
|
||||
(add-hook! 'python-mode-local-vars-hook :append
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"Where to store eshell configuration files, as opposed to
|
||||
`eshell-directory-name', which is where Doom will store temporary/data files.")
|
||||
|
||||
(defvar eshell-directory-name (concat doom-etc-dir "eshell")
|
||||
(defvar eshell-directory-name (concat doom-data-dir "eshell")
|
||||
"Where to store temporary/data files, as opposed to `eshell-config-dir',
|
||||
which is where Doom will store eshell configuration files.")
|
||||
|
||||
|
|
|
@ -112,8 +112,8 @@
|
|||
:when (and (modulep! +lsp) (not (modulep! :tools lsp +eglot)))
|
||||
:hook (dap-mode . dap-tooltip-mode)
|
||||
:init
|
||||
(setq dap-breakpoints-file (concat doom-etc-dir "dap-breakpoints")
|
||||
dap-utils-extension-path (concat doom-etc-dir "dap-extension/"))
|
||||
(setq dap-breakpoints-file (concat doom-data-dir "dap-breakpoints")
|
||||
dap-utils-extension-path (concat doom-data-dir "dap-extension/"))
|
||||
(after! lsp-mode (require 'dap-mode))
|
||||
:config
|
||||
(pcase-dolist (`((,category . ,modules) :after ,after :require ,libs)
|
||||
|
|
|
@ -198,7 +198,7 @@ Dictionary.app behind the scenes to get definitions.")
|
|||
(add-hook '+lookup-documentation-functions #'+lookup-dash-docsets-backend-fn)
|
||||
:config
|
||||
(setq dash-docs-enable-debugging init-file-debug
|
||||
dash-docs-docsets-path (concat doom-etc-dir "docsets/")
|
||||
dash-docs-docsets-path (concat doom-data-dir "docsets/")
|
||||
dash-docs-min-length 2
|
||||
dash-docs-browser-func #'eww)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ Can be a list of backends; accepts any value `company-backends' accepts.")
|
|||
:init
|
||||
;; Don't touch ~/.emacs.d, which could be purged without warning
|
||||
(setq lsp-session-file (concat doom-cache-dir "lsp-session")
|
||||
lsp-server-install-dir (concat doom-etc-dir "lsp"))
|
||||
lsp-server-install-dir (concat doom-data-dir "lsp"))
|
||||
;; Don't auto-kill LSP server after last workspace buffer is killed, because I
|
||||
;; will do it for you, after `+lsp-defer-shutdown' seconds.
|
||||
(setq lsp-keep-workspace-alive nil)
|
||||
|
@ -41,7 +41,7 @@ Can be a list of backends; accepts any value `company-backends' accepts.")
|
|||
:config
|
||||
(add-to-list 'doom-debug-variables 'lsp-log-io)
|
||||
|
||||
(setq lsp-intelephense-storage-path (concat doom-etc-dir "lsp-intelephense/")
|
||||
(setq lsp-intelephense-storage-path (concat doom-data-dir "lsp-intelephense/")
|
||||
lsp-vetur-global-snippets-dir
|
||||
(expand-file-name
|
||||
"vetur" (or (bound-and-true-p +snippets-dir)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
(defun set-eglot-client! (mode server-call)
|
||||
"Add SERVER-CALL list as a possible lsp server for given major MODE.
|
||||
|
||||
Example : (set-eglot-client! 'python-mode `(,(concat doom-etc-dir \"lsp/mspyls/Microsoft.Python.LanguageServer\")))"
|
||||
Example : (set-eglot-client! 'python-mode `(,(concat doom-data-dir \"lsp/mspyls/Microsoft.Python.LanguageServer\")))"
|
||||
(after! eglot
|
||||
(add-to-list 'eglot-server-programs `(,mode . ,server-call))))
|
||||
|
||||
|
|
|
@ -22,9 +22,9 @@ Only has an effect in GUI Emacs.")
|
|||
:init
|
||||
(setq magit-auto-revert-mode nil) ; we do this ourselves further down
|
||||
;; Must be set early to prevent ~/.emacs.d/transient from being created
|
||||
(setq transient-levels-file (concat doom-etc-dir "transient/levels")
|
||||
transient-values-file (concat doom-etc-dir "transient/values")
|
||||
transient-history-file (concat doom-etc-dir "transient/history"))
|
||||
(setq transient-levels-file (concat doom-data-dir "transient/levels")
|
||||
transient-values-file (concat doom-data-dir "transient/values")
|
||||
transient-history-file (concat doom-data-dir "transient/history"))
|
||||
:config
|
||||
(add-to-list 'doom-debug-variables 'magit-refresh-verbose)
|
||||
|
||||
|
@ -151,7 +151,7 @@ Only has an effect in GUI Emacs.")
|
|||
:after-call magit-status
|
||||
:commands forge-create-pullreq forge-create-issue
|
||||
:preface
|
||||
(setq forge-database-file (concat doom-etc-dir "forge/forge-database.sqlite"))
|
||||
(setq forge-database-file (concat doom-data-dir "forge/forge-database.sqlite"))
|
||||
(setq forge-add-default-bindings (not (modulep! :editor evil +everywhere)))
|
||||
:config
|
||||
;; All forge list modes are derived from `forge-topic-list-mode'
|
||||
|
@ -200,9 +200,9 @@ ensure it is built when we actually use Forge."
|
|||
(dolist (state states)
|
||||
(evil-collection-define-key state 'code-review-mode-map evil-binding fn))))
|
||||
(evil-set-initial-state 'code-review-mode evil-default-state))
|
||||
(setq code-review-db-database-file (concat doom-etc-dir "code-review/code-review-db-file.sqlite")
|
||||
code-review-log-file (concat doom-etc-dir "code-review/code-review-error.log")
|
||||
code-review-download-dir (concat doom-etc-dir "code-review/"))
|
||||
(setq code-review-db-database-file (concat doom-data-dir "code-review/code-review-db-file.sqlite")
|
||||
code-review-log-file (concat doom-data-dir "code-review/code-review-error.log")
|
||||
code-review-download-dir (concat doom-data-dir "code-review/"))
|
||||
:config
|
||||
(transient-append-suffix 'magit-merge "i"
|
||||
'("y" "Review pull request" +magit/start-code-review))
|
||||
|
|
|
@ -45,7 +45,7 @@ stored in `persp-save-dir'.")
|
|||
persp-reset-windows-on-nil-window-conf nil
|
||||
persp-nil-hidden t
|
||||
persp-auto-save-fname "autosave"
|
||||
persp-save-dir (concat doom-etc-dir "workspaces/")
|
||||
persp-save-dir (concat doom-data-dir "workspaces/")
|
||||
persp-set-last-persp-for-new-frames t
|
||||
persp-switch-to-added-buffer nil
|
||||
persp-kill-foreign-buffer-behaviour 'kill
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue