Emacs enum indentation
- by Masterofpsi
I'm having a problem with Emacs's indentation of Java enums. While it indents the first member OK, it wants to give all of the rest of the static enum members an additional level of indentation. It looks like this:
class MyClass {
public enum MyEnum {
ONE(1), //good
TWO(2), // not good!
THREE(3),
FOUR(4);
private final int value;
}
}
When I run C-c C-s on the line that opens the enum, it gives me ((inclass 1) (topmost-intro 1)), which doesn't seem quite right -- it seems like it should be giving brace-list-open. When I run it on the first enum member, it gives me ((defun-block-intro 21)), which is definitely not right. Every subsequent member gives (statement-cont 50).
I'm in java-mode and I'm using the java style of indentation. Does anyone know what the problem might be?