org-capture.el (org-capture-refile): Don't finalize prematurely
authorBastien Guerry <bzg@altern.org>
Wed, 6 Nov 2013 15:26:38 +0000 (16:26 +0100)
committerBastien Guerry <bzg@altern.org>
Wed, 6 Nov 2013 15:26:38 +0000 (16:26 +0100)
* org-capture.el (org-capture-refile): Don't finalize
prematurely.

Thanks to Rodrigo Amestica for reporting this.

lisp/org-capture.el

index 804539e..39804ac 100644 (file)
@@ -789,14 +789,14 @@ already gone.  Any prefix argument will be passed to the refile command."
   (let ((pos (point))
        (base (buffer-base-buffer (current-buffer)))
        (org-refile-for-capture t))
-    (org-capture-finalize)
     (save-window-excursion
       (with-current-buffer (or base (current-buffer))
        (save-excursion
          (save-restriction
            (widen)
            (goto-char pos)
-           (call-interactively 'org-refile)))))))
+           (call-interactively 'org-refile)))))
+    (org-capture-finalize)))
 
 (defun org-capture-kill ()
   "Abort the current capture process."