Function: org-get-outline-path
org-get-outline-path is a byte-compiled function defined in org.el.gz.
Signature
(org-get-outline-path &optional WITH-SELF USE-CACHE)
Documentation
Return the outline path to the current entry.
An outline path is a list of ancestors for current headline, as a list of strings. Statistics cookies are removed and links are replaced with their description, if any, or their path otherwise.
When optional argument WITH-SELF is non-nil, the path also includes the current headline.
When optional argument USE-CACHE is non-nil, cache outline paths
between calls to this function so as to avoid backtracking. This
argument is useful when planning to find more than one outline
path in the same document. In that case, there are two
conditions to satisfy:
- org-outline-path-cache is set to nil before starting the
process;
- outline paths are computed by increasing buffer positions.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-get-outline-path (&optional with-self use-cache)
"Return the outline path to the current entry.
An outline path is a list of ancestors for current headline, as
a list of strings. Statistics cookies are removed and links are
replaced with their description, if any, or their path otherwise.
When optional argument WITH-SELF is non-nil, the path also
includes the current headline.
When optional argument USE-CACHE is non-nil, cache outline paths
between calls to this function so as to avoid backtracking. This
argument is useful when planning to find more than one outline
path in the same document. In that case, there are two
conditions to satisfy:
- `org-outline-path-cache' is set to nil before starting the
process;
- outline paths are computed by increasing buffer positions."
(org-with-wide-buffer
(and (or (and with-self (org-back-to-heading t))
(org-up-heading-safe))
(reverse (org--get-outline-path-1 use-cache)))))