I'm trying to get emacs to correctly format the "for each" construct in c++.
I want the braces to be lined up with the f
in for
in both of the following examples:
for each(Type a in b)
{ //^c^s shows substatement-open
//... do stuff
}
for( ; ; )
{ //^c^s shows substatement-open
//... do stuff
}
In both cases, using [Ctrl-c Ctrl-s] (or [Ctrl-c Ctrl-o]) shows that both opening { characters are of type substatement-open
and when viewing the c-offsets-alist
I see that substatement-open
is equal to 0.
How can I make emacs indent the for each()
command similar to how it indents the for(;;)
command?