From 54d8c49d8bab086bbd11f06991779d7da152b48b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 19 Mar 2022 19:45:46 +0100 Subject: [PATCH] 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. --- modules/editor/file-templates/config.el | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/editor/file-templates/config.el b/modules/editor/file-templates/config.el index 2ef1d1f3f..27e580e89 100644 --- a/modules/editor/file-templates/config.el +++ b/modules/editor/file-templates/config.el @@ -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 (file-exists-p buffer-file-name)) (not (buffer-modified-p)) + (null (buffer-base-buffer)) (when-let (rule (cl-find-if #'+file-template-p +file-templates-alist)) (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