mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -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))))
|
(unless global 1))))
|
||||||
path))
|
path))
|
||||||
("P"
|
("P"
|
||||||
(let ((default-directory (file-name-directory (expand-file-name path))))
|
(let* ((default-directory (file-name-directory (expand-file-name path)))
|
||||||
(abbreviate-file-name (doom-project-root))))
|
(project-root (doom-project-root)))
|
||||||
|
(unless project-root
|
||||||
|
(user-error "Not in a project"))
|
||||||
|
(abbreviate-file-name project-root)))
|
||||||
(_ path))
|
(_ path))
|
||||||
"")))
|
"")))
|
||||||
;; strip trailing slash, if applicable
|
;; strip trailing slash, if applicable
|
||||||
|
Reference in New Issue
Block a user