In org-mode whenever I have point on heading it shows me in the mini buffer the full hierarchy. For example, if I have the following in a Org file:

* lvl1
** lvl2
*** lvl3
    some text

And I put point on lvl3 it shows /lvl1/lvl2/lvl3 in the mini buffer. Is there a specific function I can call to obtain this information? I sometimes need to retrieve context and with this it would be easier, no need to move point to the heading.

  • What version of org-mode are you using?
    – Melioratus
    Jun 5, 2018 at 19:07
  • 1
    @Melioratus I forgot to mention that I'am using spacemacs. I'am using the org layer and org-version tell me the version is "9.1.13".
    – plx
    Jun 6, 2018 at 7:31

1 Answer 1


org-get-outline-path will return a list with the heading hierarchy.

org-format-outline-path will take such a path and format it for display. This is what goes into your mini-buffer.

  • 4
    To test this, add an emacs-lisp code block after "some text" in your sample file with content: (org-get-outline-path t), place cursor after the parenthesis, and press C-x C-e.
    – Heikki
    Jun 5, 2018 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.