May 1, 2009 7:31 PM
Eclipse is good. But as a die hard Emacs fan, Emacs is the IDE for me. I needed a better way to quickly switch back and forth between Emacs and Eclipse. So I cooked up an Eclipse plugin that does exactly that. Click a button in the toolbar and the current active window in Eclipse will open in Emacs. It will also try to position the cursor at the same place it was in the Eclipse window. Also, you can configure the plug-in to execute any lisp code after doing this.
This plug-in uses gnuserve (available at Andy Norman's site and at meltin.net) and requires gnuclientw to be in the PATH variable. You can also point to the full path to gnuclientw in the plugin's preferences page.
Emacs Plugin for Eclipse Toolbar and Menu:
The plug-in and its sources (licensed under the LGPL) can be downloaded from:
This plugin has been tested with Eclipse ganymede and Emacs 22.1. Not sure if this will work in other versions of Eclipse. If you do manage to get it to work, drop in a comment and I'll update this article.
Note for Flex Builder Users
Strangely, when an Actionscript or MXML file is opened via the Flex
returns an offset which does not directly map the character position
in Emacs. So this caused the cursor position in emacs to be more than
the actual. Till this is worked out, in the case of MXML and AS files,
the plugin will only move the cursor to the correct line and not the
correct character offset in Emacs.
This issue does not affect the Java or any other perspective.
The only way to open a file in Emacs from Eclipse was to right click the file and say "Open In" another editor and pick gnuclientw. This closes the window in Eclipse and any time you open that file, it always opens in Emacs. Needless to say, this was very frustrating.
I had tried out the Emacs Plug-In for Eclipse by Alan Donovan and was disappointed when it did not work. As he had LGPLed his source, I used it to build this plugin.