emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-copy-subtree
@ 2013-02-02 20:05 42 147
  2013-02-02 20:53 ` org-copy-subtree Suvayu Ali
  0 siblings, 1 reply; 2+ messages in thread
From: 42 147 @ 2013-02-02 20:05 UTC (permalink / raw)
  To: Org Mode

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

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.

[-- Attachment #2: Type: text/html, Size: 431 bytes --]

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

* Re: org-copy-subtree
  2013-02-02 20:05 org-copy-subtree 42 147
@ 2013-02-02 20:53 ` Suvayu Ali
  0 siblings, 0 replies; 2+ messages in thread
From: Suvayu Ali @ 2013-02-02 20:53 UTC (permalink / raw)
  To: emacs-orgmode

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.

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

end of thread, other threads:[~2013-02-02 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-02 20:05 org-copy-subtree 42 147
2013-02-02 20:53 ` org-copy-subtree Suvayu Ali

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).