emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Gary Oberbrunner <garyo@oberbrunner.com>
Cc: Orgmode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: turn headline(s) into plain list?
Date: Sat, 07 May 2011 10:20:06 -0400	[thread overview]
Message-ID: <87hb96pp7t.fsf@fastmail.fm> (raw)
In-Reply-To: <87liyippca.fsf@fastmail.fm> (Matt Lundin's message of "Sat, 07 May 2011 10:17:25 -0400")

Matt Lundin <mdl@imapmail.org> writes:

> Gary Oberbrunner <garyo@oberbrunner.com> writes:
>
>> Is there any way to turn a headline (and its subtree) into a plain
>> list (and nested list items)?  Or better yet, turn all level N and
>> below headlines into plain lists at the corresponding level?
>
> For the latter, you could use org-map-entries:
>
> (defun org-convert-low-levels-to-list (level)
>   "Convert headings in file equal or greater than LEVEL to lists.
> A numeric prefix argument can be used to set the level. The
> default level is three"
>   (interactive "P")
>   (let ((level (number-to-string (or level 3))))
>     (org-map-entries 'org-ctrl-c-minus
> 		     (concat "+LEVEL>=" level) 'file)))
>

As an example, the function above converts the following:

--8<---------------cut here---------------start------------->8---
* One
** Two
*** Three
**** Four
***** Five
****** Six
******* Seven
****** Six
***** Five
**** Four
*** Three
** Two
* One
--8<---------------cut here---------------end--------------->8---

To this:

--8<---------------cut here---------------start------------->8---
* One
** Two
    - Three
      - Four
        - Five
          - Six
            - Seven
          - Six
        - Five
      - Four
    - Three
** Two
* One
--8<---------------cut here---------------end--------------->8---

Best,
Matt

      reply	other threads:[~2011-05-07 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06 18:39 turn headline(s) into plain list? Gary Oberbrunner
2011-05-06 18:55 ` Bernt Hansen
2011-05-06 18:57 ` Juan Pechiar
2011-05-06 19:14   ` Bernt Hansen
2011-05-07 14:17 ` Matt Lundin
2011-05-07 14:20   ` Matt Lundin [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=87hb96pp7t.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=garyo@oberbrunner.com \
    /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).