GNU Emacs Manual. Node: Nroff Mode

PREVTeX Mode UPText NEXTFormatted Text

19.10: Nroff Mode

Nroff mode is a mode like Text mode but modified to handle nroff commands present in the text. Invoke M-x nroff-mode to enter this mode. It differs from Text mode in only a few ways. All nroff command lines are considered paragraph separators, so that filling will never garble the nroff commands. Pages are separated by `.bp' commands. Comments start with backslash-doublequote. Also, three special commands are provided that are not in Text mode:


Move to the beginning of the next line that isn't an nroff command (forward-text-line). An argument is a repeat count.

M-p Like M-n but move up (backward-text-line).
M-? Prints in the echo area the number of text lines (lines that are not nroff commands) in the region (count-text-lines).

The other feature of Nroff mode is that you can turn on Electric Nroff mode. This is a minor mode that you can turn on or off with M-x electric-nroff-mode (see Minor Modes). When the mode is on, each time you use RET to end a line that contains an nroff command that opens a kind of grouping, the matching nroff command to close that grouping is automatically inserted on the following line. For example, if you are at the beginning of a line and type . ( b RET, this inserts the matching command `.)b' on a new line following point.

If you use Outline minor mode with Nroff mode (see Outline Mode), heading lines are lines of the form `.H' followed by a number (the header level).

Entering Nroff mode runs the hook text-mode-hook, followed by the hook nroff-mode-hook (see Hooks).

PREVTeX Mode UPText NEXTFormatted Text