Function: org-up-heading-or-point-min

org-up-heading-or-point-min is a byte-compiled function defined in org.el.gz.

Signature

(org-up-heading-or-point-min)

Documentation

Move to the heading line of which the present is a subheading, or point-min.

This version is needed to make point-min behave like a virtual heading of level 0 for property-inheritance. It will return the level of the headline found (down to 0) or nil if already at a point before the first headline or at point-min.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-up-heading-or-point-min ()
  "Move to the heading line of which the present is a subheading, or point-min.
This version is needed to make point-min behave like a virtual
heading of level 0 for property-inheritance.  It will return the
level of the headline found (down to 0) or nil if already at a
point before the first headline or at point-min."
  (when (ignore-errors (org-back-to-heading t))
    (if (< 1 (funcall outline-level))
	(or (org-up-heading-safe)
            ;; The first heading may not be level 1 heading.
            (goto-char (point-min)))
      (unless (= (point) (point-min)) (goto-char (point-min))))))