mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
refactor(file-templates): suppress in indirect buffers
Change how we detect and suppress file template expansion in org-capture buffers (which are indirect clones). Since 99.99% of the time, an indirect clone means we're doing something special in that buffer, it seemed sensible to always suppress file templates in them. Hopefully this will be more robust than the former advice.
This commit is contained in:
@ -142,14 +142,10 @@ must be non-read-only, empty, and there must be a rule in
|
|||||||
(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))
|
||||||
(not (buffer-modified-p))
|
(not (buffer-modified-p))
|
||||||
|
(null (buffer-base-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))))
|
||||||
|
|
||||||
(defadvice! +file-templates-inhibit-in-org-capture-a (fn &rest args)
|
|
||||||
:around #'org-capture
|
|
||||||
(let ((+file-templates-inhibit t))
|
|
||||||
(apply fn args)))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Bootstrap
|
;;; Bootstrap
|
||||||
|
Reference in New Issue
Block a user