From 88e3fdfdcf6a8a11ee592f2aa191bd44dc7cad1d Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sun, 13 Mar 2022 15:08:49 +0800 Subject: Save all buffers after org-refile (emacs) Implement it as overriding instead of hook --- .emacs.d/lisp/init-org.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '.emacs.d/lisp/init-org.el') diff --git a/.emacs.d/lisp/init-org.el b/.emacs.d/lisp/init-org.el index 9d4cea2..1f8e017 100644 --- a/.emacs.d/lisp/init-org.el +++ b/.emacs.d/lisp/init-org.el @@ -26,8 +26,12 @@ (funcall fn)) (advice-add 'org-agenda-quit :around 'gx/org-agenda-quit) +(defun gx/org-refile (fn &optional arg default-buffer rfloc msg) + (funcall-interactively fn arg default-buffer rfloc msg) + (org-save-all-org-buffers)) +(advice-add 'org-refile :around 'gx/org-refile) + (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) -(add-hook 'org-after-refile-insert-hook 'org-save-all-org-buffers) ;; keybinds (with-eval-after-load 'evil -- cgit v1.2.3