Java-mode seems to be unindenting rather than indenting after a method declaration.
By which I mean I'd expect to see this:
class GoodExample {
public void method() {
allNicelyIndented();
noProblemsHere();
}
}
But instead get this:
class CrazyIndenting {
public void method() { // ((inclass 134) (topmost-intro 326))
whyIsThisUnindented(); // ((defun-block-intro 379))
itsMessingWithMyHead(); // ((statement 454))
}
}
M-x c-set-style RET java
and then C-x h C-M-\
confirms that it is using the java style for the whole buffer.
Using cc-modes interactive features, C-c C-s
gives the symbols I've put in comments after the wrongly formatted code, and C-c C-o
suggests default values that look sensible. (0, + and 0 in descending statement order)
Looking through my .emacs, I ca开发者_如何学编程n't see anything that might be messing with cc-mode, so I'm a bit stuck for directions to investigate next. The unindent for the statement is less than the indent for the method declaration (2 "spaces" instead of 4), so perhaps there's some tab/space confusion?
Versions: Emacs 22.2.1, JDE 2.3.5.1 and CC-mode 5.31.5.
Although I'm not sure what's causing your problems with JDEE, I can suggest you to try out malabar-mode instead. It's the only Java mode in Emacs that's incorporating modern stuff(such as integration with maven and groovy) and is under active development...
Other than this - I'm pretty sure that basic Java indentation works ok with JDEE(and even with the older java-mode), so the problem is probably caused by you config(cc-mode configuration in particular I guess).
精彩评论