Expand %:P relative to % instead of current buffer

So ~/some/other/project/somefile.txt:P will resolve to
~/some/other/project, and not the project root of the current buffer.
This commit is contained in:
Henrik Lissner 2018-12-05 19:17:40 -05:00
parent 7b761a9b42
commit 7c3cc3ed5f

View file

@ -133,8 +133,7 @@ more information on modifiers."
(unless global 1))))
path))
("P"
(let* ((default-directory (file-name-directory (expand-file-name path)))
(project-root (doom-project-root)))
(let ((project-root (doom-project-root (file-name-directory (expand-file-name path)))))
(unless project-root
(user-error "Not in a project"))
(abbreviate-file-name project-root)))