lang/org: fix kill-confirm prompt when refiling from org-capture #462

This commit is contained in:
Henrik Lissner 2018-03-15 22:45:07 -04:00
parent cc2e4e192b
commit 0260d60dd0
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -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))