emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [patch] Add source subtree which will be refiled
@ 2011-09-29  9:19 Sebastien Vauban
  2011-10-09 11:29 ` Carsten Dominik
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2011-09-29  9:19 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-heading-string-to-refile-message.patch --]
[-- Type: text/x-patch, Size: 1515 bytes --]

From 42480fde9ea4f8e54db085dd7d34d9101deeabfe Mon Sep 17 00:00:00 2001
From: Sebastien Vauban <sva-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-10-18 16:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-29  9:19 [patch] Add source subtree which will be refiled Sebastien Vauban
2011-10-09 11:29 ` Carsten Dominik
2011-10-09 18:35   ` Sebastien Vauban
2011-10-12  5:13     ` Sebastien Vauban
2011-10-14  8:25       ` Sebastien Vauban
2011-10-14  9:20         ` [Accepted] " Carsten Dominik
2011-10-14  9:21         ` [patch] " Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).