emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mike Newman <mike@newmanfamily.me.uk>
To: emacs-orgmode@gnu.org
Subject: Re: copying headline structure without contents
Date: Thu, 23 Apr 2009 21:22:13 +0100	[thread overview]
Message-ID: <20090423212213.734d717b@newmanfamily.me.uk> (raw)
In-Reply-To: <gspdeh$d74$1@ger.gmane.org>

I think this is handled easily enough with existing org-mode + emacs
facilities

1) Mark the sub-tree (C-c @ is useful)
2) Copy and yank where you need it
3) Mark the new copy (or activate transient mark mode)
4) M-C-% (query-replace-regexp in region) to eliminate all the lines not starting with "*"

A suitable regexp should be "^[^*].*^J" where the ^J (linefeed) is entered by C-q C-j.

On Thu, 23 Apr 2009 11:47:02 +0200
Rainer Stengele <rainer.stengele@diplan.de> wrote:

> hi all,
> 
> is it possible to clone all visible or marked headlines without
> contents?
> 
> Example:
> 
> 
> Having these lines:
> 
> * header1
>   - contents
> ** header11
>    - contents
> * header2
>   - contents
> ** header21
>    - contents
> 
> 
> I'd like to have
> 
> 
> * header1
>   - contents
> ** header11
>    - contents
> * header2
>   - contents
> ** header21
>    - contents
> * header1
> ** header11
> * header2
> ** header21
> 
> 
> application:
> having written a spec for a job I want to write another
> one for a similar subject with headlines as before but changed
> contents
> 
> 
> Thanks for any thought!
> 
> Rainer
> 
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-04-23 20:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23  9:47 copying headline structure without contents Rainer Stengele
2009-04-23 20:22 ` Mike Newman [this message]
2009-04-23 20:45   ` Bernt Hansen

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=20090423212213.734d717b@newmanfamily.me.uk \
    --to=mike@newmanfamily.me.uk \
    --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).