emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [patch] Add source subtree which will be refiled
Date: Wed, 12 Oct 2011 07:13:55 +0200	[thread overview]
Message-ID: <80mxd63i7g.fsf@somewhere.org> (raw)
In-Reply-To: 80fwj2j9n2.fsf@somewhere.org

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

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.

Best regards,
  Seb

-- 
Sebastien Vauban

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-the-text-of-the-heading-when-asking-where-to-ref.patch --]
[-- Type: text/x-patch, Size: 1434 bytes --]

From 02c57d0f8d60d18be664eff0657e813ac297250f Mon Sep 17 00:00:00 2001
From: Sebastien Vauban <sva-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
Date: Wed, 12 Oct 2011 07:08:22 +0200
Subject: [PATCH] Use the text of the heading when asking where to refile an
 entry.

---
 lisp/org.el |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index b26e1a3..c033b9e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10481,14 +10481,19 @@ 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 "refill-mode region to")
+				       (t (concat "Refile subtree \""
+						  heading-text "\" 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


  reply	other threads:[~2011-10-12  5:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-10-14  8:25       ` Sebastien Vauban
2011-10-14  9:20         ` [Accepted] " Carsten Dominik
2011-10-14  9:21         ` [patch] " Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80mxd63i7g.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).