From 0260d60dd090d55e6e61967dda9644c8f59aa907 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 15 Mar 2018 22:45:07 -0400 Subject: [PATCH] lang/org: fix kill-confirm prompt when refiling from org-capture #462 --- modules/lang/org/+capture.el | 7 +++++++ 1 file changed, 7 insertions(+) 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))