views:

47

answers:

1

In emacs, it is possible to start a file off with a line this:

/* -*- mode: java; c-basic-offset: 4; indent-tabs-mode: nil -*- */

This instructs emacs to use 4 spaces for indentation. I like the idea of storing this coding style meta-information directly and explicitly in the source code. Are there any options for doing this in other IDEs? Does eclipse in particular have the ability to configure itself from a line in the emacs format or something equivalent?

+1  A: 

As far as I know: no, Eclipse Formatter won't configure itself when reading emacs instructions in the code.

This is why you can find Emacs plugins like this one for Ganymede allowing you to quickly open a file on Emacs from Eclipse!

alt text

VonC
Nice! I like this suggestion for myself, but unfortunately I can't force it on others who stubbornly insist on using the eclipse editor :)
ataylor