diff --git a/lisp/doom-profiles.el b/lisp/doom-profiles.el index 6c66c92b1..b3da2a2a7 100644 --- a/lisp/doom-profiles.el +++ b/lisp/doom-profiles.el @@ -80,16 +80,20 @@ run.") (dolist (path (flatten-list paths)) (cond ((file-directory-p path) - (dolist (subdir (doom-files-in (file-truename path) :depth 0 :match "/[^.][^/]+$" :type 'dirs :map #'file-name-base)) + (setq path (file-truename path)) + (dolist (subdir (doom-files-in path :depth 0 :match "/[^.][^/]+$" :type 'dirs :map #'file-name-base)) (unless (string-prefix-p "_" subdir) (cl-pushnew (cons (intern subdir) - (if-let (profile-file (file-exists-p! doom-profiles-config-file-name path)) - (car (doom-file-read profile-file :by 'read*)) - (let ((subdir (file-name-as-directory (abbreviate-file-name subdir)))) - `((user-emacs-directory . ,subdir) - ,@(when (file-exists-p! "lisp/doom.el" subdir) - '(doom-user-dir . ,subdir)))))) + (let* ((val (abbreviate-file-name (file-name-as-directory subdir))) + (val (if (file-name-absolute-p val) + `(,val) + `(,(abbreviate-file-name path) ,val)))) + (cons `(user-emacs-directory :path ,@val) + (if-let (profile-file (file-exists-p! doom-profiles-config-file-name path)) + (car (doom-file-read profile-file :by 'read*)) + (when (file-exists-p (doom-path path subdir "lisp/doom.el")) + '((doom-user-dir :path ,@val))))))) profiles :test #'eq :key #'car))))