From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: capture template property :kill-buffer does not let me refile Date: Wed, 06 Nov 2013 14:42:25 +0100 Message-ID: <87ob5xk5oe.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve3NY-0002Ej-Fx for emacs-orgmode@gnu.org; Wed, 06 Nov 2013 08:42:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ve3NO-0004mO-OA for emacs-orgmode@gnu.org; Wed, 06 Nov 2013 08:42:40 -0500 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:49850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve3NO-0004m3-Gt for emacs-orgmode@gnu.org; Wed, 06 Nov 2013 08:42:30 -0500 Received: by mail-wi0-f181.google.com with SMTP id ex4so3692052wid.14 for ; Wed, 06 Nov 2013 05:42:29 -0800 (PST) In-Reply-To: (Rodrigo Amestica's message of "Sun, 27 Oct 2013 21:48:40 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rodrigo Amestica Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi Rodrigo, Rodrigo Amestica 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? 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, --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=org-capture-refile.patch 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." --=-=-= Content-Type: text/plain -- Bastien --=-=-=--