Function: outline-cycle

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

Signature

(outline-cycle &optional EVENT)

Documentation

Cycle visibility state of the current heading line's body.

This cycles the visibility of the current heading line's subheadings and body between hide all, headings only and show all.

Hide all means hide all the subheadings and their bodies. Headings only means show the subheadings, but not their bodies. Show all means show all the subheadings and their bodies.

If non-nil, EVENT should be a mouse event.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/outline.el.gz
(defun outline-cycle (&optional event)
  "Cycle visibility state of the current heading line's body.

This cycles the visibility of the current heading line's subheadings
and body between `hide all', `headings only' and `show all'.

`Hide all' means hide all the subheadings and their bodies.
`Headings only' means show the subheadings, but not their bodies.
`Show all' means show all the subheadings and their bodies.

If non-nil, EVENT should be a mouse event."
  (interactive (list last-nonmenu-event))
  (save-excursion
    (when (mouse-event-p event)
      (mouse-set-point event))
    (condition-case nil
        (pcase (outline--cycle-state)
          ('hide-all
           (if (outline-has-subheading-p)
               (progn (outline-show-children)
                      (message "Only headings"))
             (outline-show-subtree)
             (message "Show all")))
          ('headings-only
           (outline-show-subtree)
           (message "Show all"))
          ('show-all
           (outline-hide-subtree)
           (message "Hide all")))
      (outline-before-first-heading nil))))