Emacs 24 Java mode does not create the correct try-with-resource construct.
class X{ void foo() { try { check();
As you can see above, statements inside such a try block are indented by an additional 4 spaces, the value of c-basic-indent , including a trailing bracket.
The only difference between try and try-with-resource that I have identified is the syntax information for the first statement in the block, the last has an additional (substatement) in the head. Could this be the reason for his break?
If I manually remove 4 spaces from the first line, then the rest of the lines are indented correctly, except for the closing bracket, which still has padding with extra spaces.
It drives me crazy. If this solution changes me, then changing c-guess-basic-syntax is non-trivial, perhaps a workaround using tips?
source share