Fix #1401
This commit is contained in:
parent
e0cd71e25f
commit
fd00870ae8
1 changed files with 5 additions and 5 deletions
|
@ -134,18 +134,18 @@ 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
|
||||||
|
;; 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))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Bootstrap
|
;;; Bootstrap
|
||||||
|
|
||||||
(after! yasnippet
|
(after! yasnippet
|
||||||
;; Prevent file-templates from breaking org-capture when target file doesn't
|
|
||||||
;; exist and has a file template.
|
|
||||||
(add-hook 'org-capture-mode-hook #'yas-abort-snippet)
|
|
||||||
|
|
||||||
(if (featurep! :editor snippets)
|
(if (featurep! :editor snippets)
|
||||||
(add-to-list 'yas-snippet-dirs '+file-templates-dir 'append #'eq)
|
(add-to-list 'yas-snippet-dirs '+file-templates-dir 'append #'eq)
|
||||||
(setq yas-prompt-functions (delq #'yas-dropdown-prompt yas-prompt-functions)
|
(setq yas-prompt-functions (delq #'yas-dropdown-prompt yas-prompt-functions)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue