diff --git a/modules/lang/org/+capture.el b/modules/lang/org/+capture.el index dd2039b98..2859b4875 100644 --- a/modules/lang/org/+capture.el +++ b/modules/lang/org/+capture.el @@ -36,6 +36,13 @@ (add-hook 'org-capture-after-finalize-hook #'+org-capture|cleanup-frame) + ;; fix #462: when refiling from org-capture, Emacs prompts to kill the + ;; underlying, modified buffer. This fixes that. + (defun +org-capture*refile (orig-fn &rest args) + (when org-capture-is-refiling + (org-save-all-org-buffers))) + (advice-add 'org-refile :after #'+org-capture*refile) + (when (featurep! :feature evil) (add-hook 'org-capture-mode-hook #'evil-insert-state))