From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: [patch] Add source subtree which will be refiled Date: Thu, 29 Sep 2011 11:19:23 +0200 Message-ID: <80lit7bt9g.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 Hello, 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. Best regards, Seb -- Sebastien Vauban --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-heading-string-to-refile-message.patch >From 42480fde9ea4f8e54db085dd7d34d9101deeabfe Mon Sep 17 00:00:00 2001 From: Sebastien Vauban Date: Thu, 29 Sep 2011 11:12:07 +0200 Subject: [PATCH] Add heading string to refile message. --- lisp/org.el | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 5961fde..b6a3a9b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10470,14 +10470,23 @@ 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))))) + (let ((heading-string nil) + (eoh nil)) + (save-excursion + (unless goto + (org-back-to-heading t) + (setq eoh (save-excursion + (outline-end-of-heading) (point))) + (setq heading-string + (buffer-substring-no-properties + (point) eoh))) + (org-refile-get-location + (cond (goto "Goto") + (regionp "Refile region to") + (t (concat "Refile subtree \"" + heading-string "\" to"))) + default-buffer + org-refile-allow-creating-parent-nodes)))))) (setq file (nth 1 it) re (nth 2 it) pos (nth 3 it)) -- 1.7.5.1 --=-=-=--