views:

592

answers:

3

I'm an emacs user who just started working for a new company where eclipse is the standard. I've tried eclipse, but I want to also experiment with JDEE (I'm coming back to Java after a long hiatus). The major stumbling block so far is getting the indentation to match. Is there an easy way to do this, or am I going to need to dig deeply into the nuts and bolts of emacs indentation?

EDIT: sorry for the confusion in this question: I do not want to get Eclipse to mimic emacs, I want emacs to mimic Eclipse. I want to be able to use emacs to modify code without screwing up the indentation that the Eclipse users expect.

+1  A: 

I'll be honest: I'm not sure exactly what you mean by making Eclipse's indentation match Emacs. But you can modify indentation here: Windows->Preferences-General->Editors

Click on the 'Text Editors' option, and you'll see the tab width properties.

One more little note, Eclipse has Emacs-style key bindings built into it: Windows->Preferences->General->Keys

Under 'Scheme', there's an option for Emacs.

Note: you can also modify the format of your Java code here: Windows->Preferences->Java->Code Style->Formatter

bedwyr
+5  A: 

You need to customize the indentation in java mode. Take a look here, here and here.

Arkadiy
Yeah, this is the sort of nuts and bolts I was trying to avoid because of some of the peculiarities of Eclipse indentation (or at least the style of it that they are using). I was hoping that somebody had already programmed an Eclipse-style that I could just drop in. Thanks for the refs tho.
Well, if you ever get it done - could you publish the alist? May be even here?
Arkadiy
A: 

Maybe one alternative is to use a command line tool such as indent , or run eclipse in batch from emacs :-)

rzr