Have :P modifier throw error when not in a project
If it returns nil, it will throw a stringp error otherwise.
This commit is contained in:
parent
ab95ae1975
commit
54749d04e6
1 changed files with 5 additions and 2 deletions
|
@ -133,8 +133,11 @@ more information on modifiers."
|
|||
(unless global 1))))
|
||||
path))
|
||||
("P"
|
||||
(let ((default-directory (file-name-directory (expand-file-name path))))
|
||||
(abbreviate-file-name (doom-project-root))))
|
||||
(let* ((default-directory (file-name-directory (expand-file-name path)))
|
||||
(project-root (doom-project-root)))
|
||||
(unless project-root
|
||||
(user-error "Not in a project"))
|
||||
(abbreviate-file-name project-root)))
|
||||
(_ path))
|
||||
"")))
|
||||
;; strip trailing slash, if applicable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue