Fix #2568: change when file-templates are expanded
This commit is contained in:
parent
8a5ffc32f5
commit
037bcf3c12
1 changed files with 2 additions and 5 deletions
|
@ -137,10 +137,7 @@ must be non-read-only, empty, and there must be a rule in
|
||||||
(bobp) (eobp)
|
(bobp) (eobp)
|
||||||
(not (member (substring (buffer-name) 0 1) '("*" " ")))
|
(not (member (substring (buffer-name) 0 1) '("*" " ")))
|
||||||
(not (file-exists-p buffer-file-name))
|
(not (file-exists-p buffer-file-name))
|
||||||
;; Prevent file-templates from breaking org-capture when target file
|
(not (buffer-modified-p))
|
||||||
;; doesn't exist and has a file template.
|
|
||||||
(or (not (fboundp 'org-capture-get))
|
|
||||||
(not (org-capture-get :new-buffer)))
|
|
||||||
(when-let (rule (cl-find-if #'+file-template-p +file-templates-alist))
|
(when-let (rule (cl-find-if #'+file-template-p +file-templates-alist))
|
||||||
(apply #'+file-templates--expand rule))))
|
(apply #'+file-templates--expand rule))))
|
||||||
|
|
||||||
|
@ -159,4 +156,4 @@ must be non-read-only, empty, and there must be a rule in
|
||||||
(yas-reload-all)))
|
(yas-reload-all)))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
(add-hook 'find-file-hook #'+file-templates-check-h)
|
(add-hook 'doom-switch-buffer-hook #'+file-templates-check-h)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue