GNU Emacs
Emacs
Dashboard

25.9 Outline Mode

Outline mode is a major mode derived from Text mode, which is specialized for editing outlines. It provides commands to navigate between entries in the outline structure, and commands to make parts of a buffer temporarily invisible, so that the outline structure may be more easily viewed. Type M-x outline-mode to switch to Outline mode. Entering Outline mode runs the hook text-mode-hook followed by the hook outline-mode-hook (see Hooks).

When you use an Outline mode command to make a line invisible (see Outline Visibility Commands), the line disappears from the screen. An ellipsis (three periods in a row) is displayed at the end of the previous visible line, to indicate the hidden text. Multiple consecutive invisible lines produce just one ellipsis.

Editing commands that operate on lines, such as C-n and C-p, treat the text of the invisible line as part of the previous visible line. Killing the ellipsis at the end of a visible line really kills all the following invisible text associated with the ellipsis.

Outline minor mode is a buffer-local minor mode which provides the same commands as the major mode, Outline mode, but can be used in conjunction with other major modes. You can type M-x outline-minor-mode to toggle Outline minor mode in the current buffer, or use a file-local variable setting to enable it in a specific file (see Local Variables in Files).

The major mode, Outline mode, provides special key bindings on the C-c prefix. Outline minor mode provides similar bindings with C-c @ as the prefix; this is to reduce the conflicts with the major mode’s special commands. (The variable outline-minor-mode-prefix controls the prefix used.)

If the outline-minor-mode-cycle user option is non- nil, the TAB and S-TAB keys are enabled on the outline heading lines. TAB cycles hiding, showing the sub-heading, and showing all for the current section. S-TAB does the same for the entire buffer.