Next: Tab Stops, Up: Indentation
Apart from the <TAB> (indent-for-tab-command
) command,
Emacs provides a variety of commands to perform indentation in other
ways.
split-line
). The text on the
line after point becomes a new line, indented to the same column where
point is located. This command first moves point forward over any
spaces and tabs. Afterward, point is positioned before the inserted
newline.
back-to-indentation
). If there are no
non-whitespace characters on the line, move to the end of the line.
tab-to-tab-stop
). See Tab Stops.
tab-to-tab-stop
instead—unless called with a numeric
argument, in which case do nothing.
delete-indentation
).
This “joins” the two lines cleanly, by replacing any indentation at
the front of the current line, together with the line boundary, with a
single space.
As a special case (useful for Lisp code), the single space is omitted if the characters to be joined are consecutive opening and closing parentheses, or if the junction follows another newline.
If there is a fill prefix, M-^ deletes the fill prefix if it
appears after the newline that is deleted. See Fill Prefix.
indent-region
).
If a numeric argument is supplied, indent every line in the region to
that column number.
If called with no argument, the command activates a transient mode for adjusting the indentation of the affected lines interactively. While this transient mode is active, typing <LEFT> or <RIGHT> indents leftward and rightward, respectively, by one space. You can also type S-<LEFT> or S-<RIGHT> to indent leftward or rightward to the next tab stop (see Tab Stops). Typing any other key disables the transient mode, and resumes normal editing.
If called with a prefix argument n, this command indents the lines forward by n spaces (without enabling the transient mode). Negative values of n indent backward, so you can remove all indentation from the lines in the region using a large negative argument, like this:
C-u -999 C-x <TAB>