fix(profiles): unexpanded paths in implicit profiles
Fixes two issues with implicit profiles: 1. Where user-emacs-directory (and sometimes doom-user-dir) would be unexpanded in the profile init file (generated by 'doom profiles sync'), which would be ineffective at runtime. 2. Where an implicit profile with a .doomprofile that lacks a user-emacs-directory setting would not have any user-emacs-directory set for it at all. Instead, it should fall back to that profile's location.
This commit is contained in:
parent
fd61150f60
commit
329d65d0d4
1 changed files with 11 additions and 7 deletions
|
@ -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))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue