feature/file-templates: rewrite & fix wrong-number-of-args errors #602
This commit is contained in:
parent
4c73ac0111
commit
b806ff937c
2 changed files with 113 additions and 114 deletions
|
@ -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)))))
|
||||
|
||||
|
||||
;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue