From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Seeger Subject: Re: Bug: org-capture-refile doc inconsistency, refile bug [8.3.1 (8.3.1-129-ga7c8d2-elpaplus @ /home/jeeger/.emacs.d/elpa/org-plus-contrib-20150921/)] Date: Fri, 25 Sep 2015 15:09:41 +0200 Message-ID: <871tdmmyqy.wl-jan.seeger@thenybble.de> References: <87io71qrbt.wl-jan.seeger@thenybble.de> <87twqjk06p.fsf@nicolasgoaziou.fr> <5F2C244C-C240-4956-9479-7D3301709B47@thenybble.de> <871tdmene3.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Fri_Sep_25_15:09:41_2015-1" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfSl7-00076Q-Hm for emacs-orgmode@gnu.org; Fri, 25 Sep 2015 09:09:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfSl3-0003nL-IP for emacs-orgmode@gnu.org; Fri, 25 Sep 2015 09:09:53 -0400 Received: from [2a01:488:66:1000:57e6:57cd:0:1] (port=43119 helo=eins.thenybble.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfSl3-0003ma-99 for emacs-orgmode@gnu.org; Fri, 25 Sep 2015 09:09:49 -0400 In-Reply-To: <871tdmene3.fsf@nicolasgoaziou.fr> 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: Jan Seeger , emacs-orgmode@gnu.org --Multipart_Fri_Sep_25_15:09:41_2015-1 Content-Type: text/plain; charset=US-ASCII Hello! I've reworked the patch to restore the original order of org-capture-finalize and org-capture-refile, but working around the interaction with :kill-buffer that required reversing the order in the first place. org-capture-finalize requires the capture buffer to be set up correctly, and restoring this correctly after refiling appears to require a lot of work. Regards, Jan --Multipart_Fri_Sep_25_15:09:41_2015-1 Content-Type: text/plain; type=patch; name="org-capture-refile.patch"; charset=US-ASCII Content-Disposition: attachment; filename="org-capture-refile.patch" Content-Transfer-Encoding: 7bit diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 67dc319..3d5df83 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -792,7 +792,10 @@ already gone. Any prefix argument will be passed to the refile command." "Refiling from a capture buffer makes only sense for `entry'-type templates")) (let ((pos (point)) (base (buffer-base-buffer (current-buffer))) - (org-refile-for-capture t)) + (org-refile-for-capture t) + (kill-buffer (org-capture-get :kill-buffer 'local))) + (org-capture-put :kill-buffer nil) + (org-capture-finalize) (save-window-excursion (with-current-buffer (or base (current-buffer)) (save-excursion @@ -800,7 +803,8 @@ already gone. Any prefix argument will be passed to the refile command." (widen) (goto-char pos) (call-interactively 'org-refile))))) - (org-capture-finalize))) + (if kill-buffer + (kill-buffer base)))) (defun org-capture-kill () "Abort the current capture process." --Multipart_Fri_Sep_25_15:09:41_2015-1--