Outline mode provides several commands for temporarily hiding or revealing parts of the buffer, based on the outline structure. These commands are not undoable; their effects are simply not recorded by the undo mechanism, so you can undo right past them (see Undo).
Many of these commands act on the current heading line. If point is on a heading line, that is the current heading line; if point is on a body line, the current heading line is the nearest preceding header line.
Make the current heading line’s body invisible
Make the current heading line’s body visible
Make everything under the current heading invisible, not including the
heading itself (
Make everything under the current heading visible, including body,
subheadings, and their bodies (
Make the body of the current heading line, and of all its subheadings,
Make all subheadings of the current heading line, at all levels,
Make immediate subheadings (one level down) of the current heading
line visible (
Make all body lines in the buffer invisible
Make all lines in the buffer visible (
Hide everything except the top n levels of heading lines
Hide everything except for the heading or body that point is in, plus
the headings leading up from there to the top level of the outline
The simplest of these commands are C-c C-c
outline-hide-entry), which hides the body lines directly
following the current heading line, and C-c C-e
outline-show-entry), which reveals them. Subheadings and
their bodies are not affected.
The commands C-c C-d (
C-c C-s (
outline-show-subtree) are more powerful. They
apply to the current heading line’s subtree: its body, all of
its subheadings, both direct and indirect, and all of their bodies.
The command C-c C-l (
outline-hide-leaves) hides the
body of the current heading line as well as all the bodies in its
subtree; the subheadings themselves are left visible. The command
C-c C-k (
outline-show-branches) reveals the subheadings,
if they had previously been hidden (e.g., by C-c C-d). The
command C-c C-i (
outline-show-children) is a weaker
version of this; it reveals just the direct subheadings, i.e., those
one level down.
The command C-c C-o (
everything except the entry that point is in, plus its parents (the
headers leading up from there to top level in the outline) and the top
level headings. It also reveals body lines preceding the first
heading in the buffer.
The remaining commands affect the whole buffer. C-c C-t
outline-hide-body) makes all body lines invisible, so that you
see just the outline structure (as a special exception, it will not
hide lines at the top of the file, preceding the first header line,
even though these are technically body lines). C-c C-a
outline-show-all) makes all lines visible. C-c C-q
outline-hide-sublevels) hides all but the top level headings
at and above the level of the current heading line (defaulting to 1 if
point is not on a heading); with a numeric argument n, it hides
everything except the top n levels of heading lines. Note that
it completely reveals all the n top levels and the body lines
before the first heading.
Outline also provides two convenience commands to cycle the
visibility of each section and the whole buffer. Typing
outline-cycle) on a heading cycles the current
section between “hide all”, “subheadings”, and “show all”
states. Typing S-TAB (
the whole buffer between “only top-level headings”, “all headings
and subheadings”, and “show all” states.
When incremental search finds text that is hidden by Outline mode,
it makes that part of the buffer visible. If you exit the search at
that position, the text remains visible. To toggle whether or not
an active incremental search can match hidden text, type M-s i.
To change the default for future searches, customize the option
search-invisible. (This option also affects how
and related functions treat hidden text, see Query Replace.)
You can also automatically make text visible as you navigate in it by
using Reveal mode (M-x reveal-mode), a buffer-local minor mode.