Next: Region Indent, Previous: Primitive Indent, Up: Indentation
An important function of each major mode is to customize the <TAB> key to indent properly for the language being edited. This section describes the mechanism of the <TAB> key and how to control it. The functions in this section return unpredictable values.
This variable's value is the function to be used by <TAB> (and various commands) to indent the current line. The command
indent-according-to-mode
does no more than call this function.In Lisp mode, the value is the symbol
lisp-indent-line
; in C mode,c-indent-line
; in Fortran mode,fortran-indent-line
. In Fundamental mode, Text mode, and many other modes with no standard for indentation, the value isindent-to-left-margin
(which is the default value).
This command calls the function in
indent-line-function
to indent the current line in a way appropriate for the current major mode.
This command calls the function in
indent-line-function
to indent the current line; however, if that function isindent-to-left-margin
,insert-tab
is called instead. (That is a trivial command that inserts a tab character.)
This function inserts a newline, then indents the new line (the one following the newline just inserted) according to the major mode.
It does indentation by calling the current
indent-line-function
. In programming language modes, this is the same thing <TAB> does, but in some text modes, where <TAB> inserts a tab,newline-and-indent
indents to the column specified byleft-margin
.
This command reindents the current line, inserts a newline at point, and then indents the new line (the one following the newline just inserted).
This command does indentation on both lines according to the current major mode, by calling the current value of
indent-line-function
. In programming language modes, this is the same thing <TAB> does, but in some text modes, where <TAB> inserts a tab,reindent-then-newline-and-indent
indents to the column specified byleft-margin
.