mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
feature/file-templates: rewrite & fix wrong-number-of-args errors #602
This commit is contained in:
@ -66,8 +66,12 @@ evil is loaded and enabled)."
|
||||
;;;###autoload
|
||||
(defun +file-templates-get-short-path ()
|
||||
"Fetches a short file path for the header in Doom module templates."
|
||||
(when (string-match "/modules/\\(.+\\)$" buffer-file-truename)
|
||||
(match-string 1 buffer-file-truename)))
|
||||
(let ((path (file-truename (or buffer-file-name default-directory))))
|
||||
(cond ((string-match "/modules/\\(.+\\)$" path)
|
||||
(match-string 1 path))
|
||||
((file-in-directory-p path doom-emacs-dir)
|
||||
(file-relative-name path doom-emacs-dir))
|
||||
((abbreviate-file-name path)))))
|
||||
|
||||
|
||||
;;
|
||||
|
Reference in New Issue
Block a user