fix: defconst->defvar for more doom-*-dir vars

So they can be changed before doom.el is loaded (e.g. by profiles).
This commit is contained in:
Henrik Lissner 2022-09-17 20:10:03 +02:00
parent 4a3654d666
commit 25bc9c9765
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -176,17 +176,17 @@
"The active profile as a cons cell (NAME . VERSION).") "The active profile as a cons cell (NAME . VERSION).")
;;; Data directory variables ;;; Data directory variables
(defconst doom-emacs-dir user-emacs-directory (defvar doom-emacs-dir user-emacs-directory
"The path to the currently loaded .emacs.d directory. Must end with a slash.") "The path to the currently loaded .emacs.d directory. Must end with a slash.")
(defconst doom-core-dir (file-name-directory load-file-name) (defconst doom-core-dir (file-name-directory load-file-name)
"The root directory of Doom's core files. Must end with a slash.") "The root directory of Doom's core files. Must end with a slash.")
(defconst doom-modules-dir (expand-file-name "modules/" doom-emacs-dir) (defvar doom-modules-dir (expand-file-name "modules/" doom-emacs-dir)
"The root directory for Doom's modules. Must end with a slash.") "The root directory for Doom's modules. Must end with a slash.")
(define-obsolete-variable-alias 'doom-private-dir 'doom-user-dir "3.0.0") (define-obsolete-variable-alias 'doom-private-dir 'doom-user-dir "3.0.0")
(defconst doom-user-dir (defvar doom-user-dir
(expand-file-name (expand-file-name
(if-let (doomdir (getenv-internal "DOOMDIR")) (if-let (doomdir (getenv-internal "DOOMDIR"))
(file-name-as-directory doomdir) (file-name-as-directory doomdir)