Next: Continued Statement Indentation, Up: Code Formatting [Contents][Index]

#### 4.1.1 Code Indentation

Like all Emacs programming modes, IDLWAVE performs code indentation. The `TAB` key indents the current line relative to context. `LFD` insert a newline and indents the new line. The indentation is governed by a number of variables. IDLWAVE indents blocks (between `PRO`/`FUNCTION`/`BEGIN` and `END`), and continuation lines.

To re-indent a larger portion of code (e.g., when working with foreign code written with different conventions), use `C-M-\` (`indent-region`) after marking the relevant code. Useful marking commands are `C-x h` (the entire file) or `C-M-h` (the current subprogram). The command `C-M-q` reindents the entire current routine. See Actions, for information how to impose additional formatting conventions on foreign code.

User Option: idlwave-main-block-indent (`2`)

  Extra indentation for the main block of code. That is the block between the FUNCTION/PRO statement and the END statement for that program unit.

User Option: idlwave-block-indent (`3`)

  Extra indentation applied to block lines. If you change this, you probably also want to change `idlwave-end-offset`.

User Option: idlwave-end-offset (`-3`)

  Extra indentation applied to block END lines. A value equal to negative `idlwave-block-indent` will make END lines line up with the block BEGIN lines.