Go to the first, previous, next, last section, table of contents.


Indentation Functions

Function: indent-pos &optional pos buffer
This function returns the glyph position (see section Glyph Positions) of the first character in the line pointed to by pos (or the cursor) which is not a TAB or SPC character.

Function: set-indent-pos indent-pos &optional buffer only-spaces
Sets the indentation of the line pointed to by pos to the column pointed to by pos by putting the optimal sequence of TAB and SPC characters at the start of the line.

If the only-spaces argument is non-nil no TAB characters will be used.

Command: indent-to column &optional only-spaces
This function inserts enough TAB and SPC characters to move the cursor to glyph column column.

If the only-spaces argument is non-nil no TAB characters are used.

Note that column counts from zero.

When called interactively the column argument is either the numeric value of the prefix argument or, if no prefix argument has been entered, the result of prompting for a number.

Command: tab-with-spaces
This command inserts enough spaces at the cursor position to move the cursor to the next tab stop.

Some major modes provide their own method of indentation (for example Lisp mode will indent Lisp programs in the proper style), see section Mode-Specific Indentation.

Command: indent-line
If the current buffer has a method for indentation installed, use it to indent the current line to its correct depth.

Command: newline-and-indent
Insert a newline character, then indent the new line; if no function for indenting lines has been installed in this buffer a single TAB character is inserted.

Command: indent-area start-pos end-pos
Uses the buffer's indentation method to indent all lines in the specified region to their correct depth.

When called interactively the currently-marked block is used to get the values of the two arguments, the block is then unmarked.


Go to the first, previous, next, last section, table of contents.