Next: , Previous: , Up: Editing   [Index]


8.10 Indenting

“Indentation” refers to inserting or adjusting “whitespace characters” (space and/or tab characters) at the beginning of a line of text.

If you just want to insert a tab character in the buffer, type ‘C-q <TAB>’. This always inserts a tab character, regardless of the value of ‘indent-tabs-mode’.

The simplest way to perform indentation is the ‘<TAB>’ key. In most major modes, this runs the command indent-for-tab-command. The exact behavior of ‘<TAB>’ depends on the major mode.

In Text mode and related major modes, <TAB> normally inserts some combination of space and tab characters to advance point to the next tab stop. For this purpose, the position of the first non-whitespace character on the preceding line is treated as an additional tab stop, so you can use <TAB> to align point with the preceding line.

If the region is active (*note Using Region::), ‘<TAB>’ acts specially: it indents each line in the region so that its first non-whitespace character is aligned with the preceding line.