Function: outline-up-heading

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

Signature

(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.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/outline.el.gz
(defun 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")
  (and (eq this-command 'outline-up-heading)
       (or (eq last-command 'outline-up-heading) (push-mark)))
  (outline-back-to-heading invisible-ok)
  (let ((start-level (funcall outline-level)))
    (when (<= start-level 1)
      (error "Already at top level of the outline"))
    (while (and (> start-level 1) (> arg 0) (not (bobp)))
      (let ((level start-level))
	(while (not (or (< level start-level) (bobp)))
	  (if invisible-ok
	      (outline-previous-heading)
	    (outline-previous-visible-heading 1))
	  (setq level (funcall outline-level)))
	(setq start-level level))
      (setq arg (- arg 1))))
  (if outline-search-function
      (funcall outline-search-function nil nil nil t)
    (looking-at outline-regexp)))