-\1f
-File: xemacs.info, Node: Basic Indent, Next: Multi-line Indent, Prev: Grinding, Up: Grinding
-
-Basic Program Indentation Commands
-----------------------------------
-
-`<TAB>'
- Adjust indentation of current line.
-
-`<LFD>'
- Equivalent to <RET> followed by <TAB> (`newline-and-indent').
-
- The basic indentation command is <TAB>, which gives the current line
-the correct indentation as determined from the previous lines. The
-function that <TAB> runs depends on the major mode; it is
-`lisp-indent-line' in Lisp mode, `c-indent-line' in C mode, etc. These
-functions understand different syntaxes for different languages, but
-they all do about the same thing. <TAB> in any programming language
-major mode inserts or deletes whitespace at the beginning of the
-current line, independent of where point is in the line. If point is
-inside the whitespace at the beginning of the line, <TAB> leaves it at
-the end of that whitespace; otherwise, <TAB> leaves point fixed with
-respect to the characters around it.
-
- Use `C-q <TAB>' to insert a tab at point.
-
- When entering a large amount of new code, use <LFD>
-(`newline-and-indent'), which is equivalent to a <RET> followed by a
-<TAB>. <LFD> creates a blank line, then gives it the appropriate
-indentation.
-
- <TAB> indents the second and following lines of the body of a
-parenthetical grouping each under the preceding one; therefore, if you
-alter one line's indentation to be nonstandard, the lines below tend to
-follow it. This is the right behavior in cases where the standard
-result of <TAB> does not look good.
-
- Remember that Emacs assumes that an open-parenthesis, open-brace, or
-other opening delimiter at the left margin (including the indentation
-routines) is the start of a function. You should therefore never have
-an opening delimiter in column zero that is not the beginning of a
-function, not even inside a string. This restriction is vital for
-making the indentation commands fast. *Note Defuns::, for more
-information on this behavior.
-
-\1f
-File: xemacs.info, Node: Multi-line Indent, Next: Lisp Indent, Prev: Basic Indent, Up: Grinding
-
-Indenting Several Lines
------------------------
-
- Several commands are available to re-indent several lines of code
-which have been altered or moved to a different level in a list
-structure.
-
-`C-M-q'
- Re-indent all the lines within one list (`indent-sexp').
-
-`C-u <TAB>'
- Shift an entire list rigidly sideways so that its first line is
- properly indented.
-
-`C-M-\'
- Re-indent all lines in the region (`indent-region').
-
- To re-indent the contents of a single list, position point before the
-beginning of it and type `C-M-q'. This key is bound to `indent-sexp' in
-Lisp mode, `indent-c-exp' in C mode, and bound to other suitable
-functions in other modes. The indentation of the line the sexp starts
-on is not changed; therefore, only the relative indentation within the
-list, and not its position, is changed. To correct the position as
-well, type a <TAB> before `C-M-q'.
-
- If the relative indentation within a list is correct but the
-indentation of its beginning is not, go to the line on which the list
-begins and type `C-u <TAB>'. When you give <TAB> a numeric argument,
-it moves all the lines in the group, starting on the current line,
-sideways the same amount that the current line moves. The command does
-not move lines that start inside strings, or C preprocessor lines when
-in C mode.
-
- Another way to specify a range to be re-indented is with point and
-mark. The command `C-M-\' (`indent-region') applies <TAB> to every
-line whose first character is between point and mark.
-