mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user