[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] org-copy-subtree
From: |
Suvayu Ali |
Subject: |
Re: [O] org-copy-subtree |
Date: |
Sat, 2 Feb 2013 21:53:04 +0100 |
User-agent: |
Mutt/1.5.21 (2011-07-01) |
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.