At Wed, 06 Nov 2013 14:42:25 +0100, Bastien wrote: > > [1 <text/plain (7bit)>] > Hi Rodrigo, > > Rodrigo Amestica <ramest...@gmail.com> writes: > > > based on 'printf' type logging I have found one solution that looks to me > > like a > > bug fix in org-capture-refile. But I'm obviously far from guessing any side > > effect that I could be missing. > > > > In org-capture-refile if I move org-capture-finalize after the > > save-window-excursion form then the :kill-buffer option works as expected > > without interfering with the refile operation. > > > > I meant to say a bug fix because to me it sounds more reasonable to call > > org-capture-finalize really when finished, in this specific case after > > refile. > > > > Does that make sense? > > Yes it does -- I attach a patch, can you confirm it is what you did > and it does what you want?
yes, that's what I did and it works as I expected. many thanks, Rodrigo > > Also, I'd be glad if a few others could test the patch so that we can > make more sure there are no side-effects -- I could not think of any. > > Thanks, > > [2 org-capture-refile.patch <text/x-diff (7bit)>] > diff --git a/lisp/org-capture.el b/lisp/org-capture.el > index 871382d..b832798 100644 > --- a/lisp/org-capture.el > +++ b/lisp/org-capture.el > @@ -787,14 +787,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." > [3 <text/plain (7bit)>] > > -- > Bastien