Next: , Previous: Outline Motion, Up: Outline Mode


30.8.3 Outline Visibility Commands

The other special commands of outline mode are used to make lines visible or invisible. Their names all start with hide or show. Most of them fall into pairs of opposites. They are not undoable; instead, you can undo right past them. Making lines visible or invisible is simply not recorded by the undo mechanism.

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.

C-c C-c
Make the current heading line's body invisible (hide-entry).
C-c C-e
Make the current heading line's body visible (show-entry).
C-c C-d
Make everything under the current heading invisible, not including the heading itself (hide-subtree).
C-c C-s
Make everything under the current heading visible, including body, subheadings, and their bodies (show-subtree).
C-c C-l
Make the body of the current heading line, and of all its subheadings, invisible (hide-leaves).
C-c C-k
Make all subheadings of the current heading line, at all levels, visible (show-branches).
C-c C-i
Make immediate subheadings (one level down) of the current heading line visible (show-children).
C-c C-t
Make all body lines in the buffer invisible (hide-body).
C-c C-a
Make all lines in the buffer visible (show-all).
C-c C-q
Hide everything except the top n levels of heading lines (hide-sublevels).
C-c C-o
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 (hide-other).

Two commands that are exact opposites are C-c C-c (hide-entry) and C-c C-e (show-entry). They apply to the body lines directly following the current heading line. Subheadings and their bodies are not affected.

Two more powerful opposites are C-c C-d (hide-subtree) and C-c C-s (show-subtree). Both apply to the current heading line's subtree: its body, all its subheadings, both direct and indirect, and all of their bodies. In other words, the subtree contains everything following the current heading line, up to and not including the next heading of the same or higher rank.

Intermediate between a visible subtree and an invisible one is having all the subheadings visible but none of the body. There are two commands for doing this, depending on whether you want to hide the bodies or make the subheadings visible. They are C-c C-l (hide-leaves) and C-c C-k (show-branches).

A little weaker than show-branches is C-c C-i (show-children). It makes just the direct subheadings visible—those one level down. Deeper subheadings remain invisible, if they were invisible.

Two commands have a blanket effect on the whole file. C-c C-t (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 (show-all) makes all lines visible. These commands can be thought of as a pair of opposites even though C-c C-a applies to more than just body lines.

The command C-c C-q (hide-sublevels) hides all but the top level headings. With a numeric argument n, it hides everything except the top n levels of heading lines.

The command C-c C-o (hide-other) hides everything except the heading and body text that point is in, plus its parents (the headers leading up from there to top level in the outline) and the top level headings.

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. You can also automatically make text visible as you navigate in it by using M-x reveal-mode.