java - Why does try-with-resources break indentation in Emacs?" -


emacs 24 java mode not indent new try-with-resource construct properly.

class x{     void foo() {         try {             check(); // ((statement-block-intro 35))         }     }      void bar() {         try (lock l = bar()) {                 check(); // ((substatement 140) (statement-block-intro 140))             }     } } 

as seen above, statements inside such try block indented 4 spaces, value of c-basic-indent, including closing brace.

one difference between try , try-with-resource identified syntactic-information first statement in block, latter having (substatement) @ head. reason breaks?

if manually delete 4 spaces first line rest of lines indent correctly, except closing brace, continues indented spaces.

this driving me nuts. if solving changing c-guess-basic-syntax non-trivial, perhaps workaround using advice?

this known bug in emacs , there thread on list.gnu.org issue patch, fixes bug: https://lists.gnu.org/archive/html/bug-gnu-emacs/2013-07/msg00577.html

futhermore, according this: http://osdir.com/ml/emacs-diffs-gnu/2013-07/msg00350.html seems, bug fixed on 2013-07-27.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -