emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: org-copy-subtree
Date: Sat, 2 Feb 2013 21:53:04 +0100	[thread overview]
Message-ID: <20130202205304.GC5816@kuru.dyndns-at-home.com> (raw)
In-Reply-To: <CAMgvimERBPTnfVix8DRHKrg+Fb4wrWRwYj0X=5UJrJxJdyi4yg@mail.gmail.com>

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.

      reply	other threads:[~2013-02-02 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-02 20:05 org-copy-subtree 42 147
2013-02-02 20:53 ` Suvayu Ali [this message]

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=20130202205304.GC5816@kuru.dyndns-at-home.com \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=emacs-orgmode@gnu.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).