From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: org-copy-subtree Date: Sat, 2 Feb 2013 21:53:04 +0100 Message-ID: <20130202205304.GC5816@kuru.dyndns-at-home.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1k5G-0001AL-Ph for emacs-orgmode@gnu.org; Sat, 02 Feb 2013 15:53:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1k5F-0001aM-Ae for emacs-orgmode@gnu.org; Sat, 02 Feb 2013 15:53:10 -0500 Received: from mail-we0-x22d.google.com ([2a00:1450:400c:c03::22d]:61563) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1k5F-0001aB-4f for emacs-orgmode@gnu.org; Sat, 02 Feb 2013 15:53:09 -0500 Received: by mail-we0-f173.google.com with SMTP id r5so3761875wey.4 for ; Sat, 02 Feb 2013 12:53:07 -0800 (PST) Content-Disposition: inline In-Reply-To: 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: emacs-orgmode@gnu.org On Sat, Feb 02, 2013 at 03:05:37PM -0500, 42 147 wrote: > I want to copy the text in the subtree, but not the headline. Right now I > use the following hack: > > (org-narrow-to-subtree) > (beginning-of-buffer) > (next-line 1) > (setq minPoint (point)) > (copy-region-as-kill minPoint (point-max)) > (widen) > > However, org-copy-subtree would do exactly what I need, IF it did not copy > the headline. Then I could cut out four lines of the above code. Well, a sub-tree is defined the headline and any text including other sub-trees under it. If org-copy-subtree didn't copy the headline it wouldn't be doing what the name says would it? :) You could always put the above code inside a defun called org-copy-subtree and load it after you have loaded org. Then it would overwrite the original org-copy-subtree and you could keep using commands like org-copy-special as usual. Caveat: If some part of org uses org-copy-subtree, that would start misbehaving. Of course you always have the option of putting it into my-org-copy-subtree and assigning a keybinding for it. Hope this helps, -- Suvayu Open source is the future. It sets us free.