Function: org-find-top-headline
org-find-top-headline is a byte-compiled function defined in
org-agenda.el.gz.
Signature
(org-find-top-headline &optional POS)
Documentation
Find the topmost parent headline and return it.
POS when non-nil is the marker or buffer position to start the search from.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-find-top-headline (&optional pos)
"Find the topmost parent headline and return it.
POS when non-nil is the marker or buffer position to start the
search from."
(save-excursion
(with-current-buffer (if (markerp pos) (marker-buffer pos) (current-buffer))
(when pos (goto-char pos))
;; Skip up to the topmost parent.
(while (org-up-heading-safe))
(ignore-errors
(replace-regexp-in-string
"^\\[[0-9]+/[0-9]+\\] *\\|^\\[%[0-9]+\\] *" ""
(nth 4 (org-heading-components)))))))