Function: hyrolo-outline-up-heading

hyrolo-outline-up-heading is an interactive and byte-compiled function defined in hyrolo.el.

Signature

(hyrolo-outline-up-heading ARG &optional INVISIBLE-OK)

Documentation

Move to the visible heading line of which the present line is a subheading.

With argument, move up ARG levels. If INVISIBLE-OK is non-nil, also consider invisible lines.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hyrolo.el
(defun hyrolo-outline-up-heading (arg &optional invisible-ok)
  "Move to the visible heading line of which the present line is a subheading.
With argument, move up ARG levels.
If INVISIBLE-OK is non-nil, also consider invisible lines."
  (interactive "p")
  (hyrolo-funcall-match
   (lambda ()
     (and (eq this-command 'hyrolo-outline-up-heading)
	  (or (eq last-command 'hyrolo-outline-up-heading) (push-mark)))
     (outline-back-to-heading invisible-ok)
     (let ((start-level (funcall outline-level))
	   (start-point (point)))
       (when (<= start-level 1)
	 (error "Already at top level of this outline tree"))
       (while (and (> start-level 1) (> arg 0) (not (bobp)))
	 (let ((level start-level)
	       (opoint (point)))
	   (while (not (or (< level start-level) (bobp)))
	     (if invisible-ok
		 (outline-previous-heading)
	       (outline-previous-visible-heading 1))
	     (setq level (funcall outline-level))
	     (when (not (looking-at hyrolo-entry-regexp))
	       ;; Have moved into a file header; move back to opoint and stop
	       (goto-char opoint)
	       ;; Exit
	       (when (= opoint start-point)
		 (error "Already at top level of this outline tree"))
	       (setq level -1)))
	   (setq start-level level))
	 (setq arg (- arg 1))))
     (looking-at outline-regexp))
   t))