emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get list of top-level headings


From: Jonathan Gregory
Subject: Re: Get list of top-level headings
Date: Wed, 19 May 2021 11:15:11 -0300
User-agent: mu4e 1.5.11; emacs 27.1

Hi

On 19 May 2021, John Kitchin wrote:

I think this is all you need to get a list of titles of level 1
headings as strings

(org-map-entries (lambda () (fifth (org-heading-components)))
"LEVEL=1")

this also works for me:

#+BEGIN_SRC emacs-lisp
(org-map-entries (lambda () (org-element-property :title
(org-element-at-point)) ) "LEVEL=1")
#+END_SRC

This is a better approach indeed. No need to create a new list, although I get faster results using:

(while (re-search-backward org-complex-heading-regexp nil t)


--
Jonathan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]