Matt Lundin <m...@imapmail.org> writes:

> Gary Oberbrunner <ga...@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 via email to