Function: outline-back-to-heading@fix-for-org-fold
outline-back-to-heading@fix-for-org-fold is a byte-compiled function
defined in org-compat.el.
Signature
(outline-back-to-heading@fix-for-org-fold OLDFUN &optional INVISIBLE-OK &rest EXTRA)
Documentation
Run org-back-to-heading when in org-mode.
Source Code
;; Defined in ~/.emacs.d/elpa/org-9.8.2/org-compat.el
(define-advice outline-back-to-heading (:around (oldfun &optional invisible-ok &rest extra) fix-for-org-fold)
"Run `org-back-to-heading' when in org-mode."
(if (derived-mode-p 'org-mode)
(progn
(forward-line 0)
(or (org-at-heading-p (not invisible-ok))
(let (found)
(save-excursion
(while (not found)
(or (re-search-backward (concat "^\\(?:" outline-regexp "\\)")
nil t)
(signal 'outline-before-first-heading nil))
(setq found (and (or invisible-ok (not (org-invisible-p)))
(point)))))
(goto-char found)
found)))
;; Apply EXTRA to avoid breakages if advised function definition
;; changes.
(apply oldfun invisible-ok extra)))