Next: Outline Views, Previous: Outline Motion, Up: Outline Mode
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.
outline-hide-entry
).
outline-show-entry
).
outline-hide-subtree
).
outline-show-subtree
).
outline-hide-leaves
).
outline-show-branches
).
outline-show-children
).
outline-hide-body
).
outline-show-all
).
outline-hide-sublevels
).
outline-hide-other
).
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 (outline-hide-subtree
) and
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 (outline-hide-other
) hides
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.
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 query-replace
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.