GNU bug report logs -
#33744
26.1; ada-mode 6.0.0 indentation of operators starting a line in a multi-line expression
Previous Next
Full log
View this message in rfc822 format
Package: emacs, ada-mode
X-Debbug-CC: ada-mode-users <at> nongnu.org
Hello, consider the line marked "incorrectly indented" below:
procedure Operator_Indentation is
begin
if B
or else C
> 2 -- incorrectly indented
then
null;
end if;
end Operator_Indentation;
We think the indentation performed by ada-mode 6.0.0 is incorrect.
Of course we understand that the line is indented relative to B
but as this line is part of a sub-expression, we think it should be
indented relative to the sub-expression instead. We cannot decide
which of the two following alternatives is the most "correct":
procedure Operator_Indentation is
begin
if B
or else C
> 2 -- indented relative to "or else"
then
null;
end if;
end Operator_Indentation;
procedure Operator_Indentation is
begin
if B
or else C
> 2 -- indented relative to C, which starts the
sub-expression
then
null;
end if;
end Operator_Indentation;
(we set ada-indent to 2).
Of course, these examples are overly simplified; in our real code base,
we don't write our operators on a separate line unless the previous line
("C" in these examples) is very long. To illustrate this, our actual
code
looks more like:
procedure Operator_Indentation is
begin
if Blarg_Meets_Preconditions_For_Subsequent_Test (Blarg)
or else Critical_Cruising_Configuration_Condition_Code
(Blarg.Blurp)
> 2
then
null;
end if;
end Operator_Indentation;
PS. The value of ada-indent-hanging-rel-exp has no effect in this
particular case.
--
Ludovic Brenta.
This bug report was last modified 6 years and 216 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.