From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [patch] Add source subtree which will be refiled Date: Fri, 14 Oct 2011 10:25:14 +0200 Message-ID: <80lisogetx.fsf@somewhere.org> References: <80lit7bt9g.fsf@somewhere.org> <80fwj2j9n2.fsf@somewhere.org> <80mxd63i7g.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org --=-=-= Content-Type: text/plain Hi Carsten, > "Sebastien Vauban" wrote: >> Carsten Dominik wrote: >>>> I found it difficult, sometimes, to remember which subtree we're gonna >>>> refile. When TAB'ing for multiple targets, you loose your source buffer, >>>> and can easily forget which exact subtree you had selected. >>>> >>>> Here a patch to add the name of the subtree we're operating on. >>> >>> can you please resubmit a modified patch using either (org-get-heading t t) >>> or (nth 4 (org-heading-components)) >> >> Thanks for looking at it. >> >> I'll do! > > Here it is: a modified version which only uses the text of the entry when > asking where to refile some headline. Please disregard http://patchwork.newartisans.com/patch/987/ as it contained 2 typos. This one is correct and can be applied straight away. Best regards, Seb -- Sebastien Vauban --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Use-the-text-of-the-heading-when-refiling.patch >From e86292614425dd385af7857384853e8e6245462f Mon Sep 17 00:00:00 2001 From: Sebastien Vauban Date: Fri, 14 Oct 2011 09:18:55 +0200 Subject: [PATCH] Use the text of the heading when refiling. --- lisp/org.el | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index b26e1a3..66c2507 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10481,14 +10481,20 @@ prefix argument (`C-u C-u C-u C-c C-w')." (marker-position org-clock-hd-marker))) (setq goto nil))) (setq it (or rfloc - (save-excursion - (unless goto (org-back-to-heading t)) - (org-refile-get-location - (cond (goto "Goto") - (regionp "Refile region to") - (t "Refile subtree to")) default-buffer - org-refile-allow-creating-parent-nodes - goto))))) + (let (heading-text) + (save-excursion + (unless goto + (org-back-to-heading t) + (setq heading-text + (nth 4 (org-heading-components)))) + (org-refile-get-location + (cond (goto "Goto") + (regionp "Refile region to") + (t (concat "Refile subtree \"" + heading-text "\" to"))) + default-buffer + org-refile-allow-creating-parent-nodes + goto)))))) (setq file (nth 1 it) re (nth 2 it) pos (nth 3 it)) -- 1.7.5.1 --=-=-=--