Skip to content

Instantly share code, notes, and snippets.

@jeremyf
Created February 24, 2024 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyf/1443f1b1ed97aae3f55bf8d3a27046e4 to your computer and use it in GitHub Desktop.
Save jeremyf/1443f1b1ed97aae3f55bf8d3a27046e4 to your computer and use it in GitHub Desktop.
An alternate implementation of Howard Abrams' `org-get-headings'.
;; An alternate implementation of Howard Abrams' `org-get-headings'.
;;
;; https://howardism.org/Technical/Emacs/tiddly-wiki-in-org.html
;;
;; I have not run any performance comparisons. The main difference being that
;; this implementation does not require defining the `unpropertize' function.
(defun org-get-headings ()
"Return a list of an org document's headings."
(org-element-map
(org-element-parse-buffer 'headline nil t)
'headline
(lambda (headline) (org-element-property :title headline))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment