Ada mode comes with a full set of rules for automatic indentation. You can also configure the indentation, via the following variables:
ada-broken-indent(default value: 2)
Number of columns to indent the continuation of a broken line.
ada-indent(default value: 3)
Number of columns for default indentation.
ada-indent-record-rel-type(default value: 3)
record relative to
ada-indent-return(default value: 0)
return relative to
ada-indent-return is greater than 0), or the open parenthesis
ada-indent-return is negative or 0). Note that in the second
case, when there is no open parenthesis, the indentation is done
function with the value of
ada-label-indent(default value: -4)
Number of columns to indent a label.
ada-stmt-end-indent(default value: 0)
Number of columns to indent a statement
end keyword on a separate line.
ada-when-indent(default value: 3)
when relative to
ada-indent-is-separate(default value: t)
nil means indent
is separate or
is abstract if on a single line.
ada-indent-to-open-paren(default value: t)
nil means indent according to the innermost open parenthesis.
ada-indent-after-return(default value: t)
nil means that the current line will also be re-indented
before inserting a newline, when you press RET.
Most of the time, the indentation will be automatic, i.e., when you press RET, the cursor will move to the correct column on the next line.
You can also indent single lines, or the current region, with TAB.
Another mode of indentation exists that helps you to set up your indentation scheme. If you press C-c TAB, Ada mode will do the following:
The exact indentation of the current line is the same as the one for the reference line, plus an offset given by the variable.
Indent the current line or the current region.
Indent lines in the current region.
Indent the current line and display the name of the variable used for indentation.