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-modedoes little 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. The default value isindent-relative. See Auto-Indentation.
This command calls the function in
indent-line-functionto indent the current line in a way appropriate for the current major mode.
This command calls the function in
indent-line-functionto indent the current line; however, if that function isindent-to-left-margin,insert-tabis called instead. (That is a trivial command that inserts a tab character.) If rigid is non-nil, this function also rigidly indents the entire balanced expression that starts at the beginning of the current line, to reflect change in indentation of the current line.
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-indentindents 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-indentindents to the column specified byleft-margin.