From 9b4f7ead886fc3964ac7f60c420e5ac322683481 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 9 Jan 2025 14:32:51 -0500 Subject: [PATCH] fix(lib): doom-profiles-bootloadable-p: respect XDG_CONFIG_HOME --- lisp/lib/profiles.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/lib/profiles.el b/lisp/lib/profiles.el index f72838157..d59ea2755 100644 --- a/lisp/lib/profiles.el +++ b/lisp/lib/profiles.el @@ -91,10 +91,16 @@ run.") ;;; Helpers (defun doom-profiles-bootloadable-p () - "Return non-nil if `doom-emacs-dir' can be a bootloader." + "Return non-nil if `doom-emacs-dir' can be a bootloader. + +This means it must be deployed to $XDG_CONFIG_HOME/emacs or $HOME/.emacs.d. Doom +cannot bootload from an arbitrary location." (with-memoization (get 'doom 'bootloader) - (or (file-equal-p doom-emacs-dir "~/.config/emacs") - (file-equal-p doom-emacs-dir "~/.emacs.d")))) + (or (file-equal-p doom-emacs-dir "~/.emacs.d") + (file-equal-p + doom-emacs-dir (expand-file-name + "emacs/" (or (getenv "XDG_CONFIG_HOME") + "~/.config")))))) (defun doom-profiles-read (&rest paths) "TODO"