emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [jdee-users] Implementing Eclipse's "organize-imports" in Emacs Lisp


From: Carlos Konstanski
Subject: Re: [jdee-users] Implementing Eclipse's "organize-imports" in Emacs Lisp
Date: Thu, 24 Jan 2008 06:59:10 -0700
User-agent: Wanderlust/2.14.1 (Bad Medicine-pre) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.7 Emacs/22.1 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

At Thu, 24 Jan 2008 03:07:25 -0500,
Paul Michael Reilly wrote:
> 
> Lennart Borgman (gmail) wrote:
> > Paul Michael Reilly wrote:
> >> I probably spend half my time doing Java development in Emacs and the
> >> other half in Eclipse.  I once tried to get the Eclipse plugin that
> >> talks to Emacsclient to work better for me with only marginal success.
> >> It is an option to revive this effort.  But even if this were to work
> >> nicely, it's appeal is limited to Eclipse developers leaving NetBeans,
> >> IntelliJ, JBuilder, etc. Users out of the solution space.
> >>
> >> One of the Eclipse features that I find indispensable is the Organize
> >> Imports feature which analyses the source file to determine if the
> >> import statements need to be pruned, augmented or modified (based on
> >> the .classpath file which is problematic since this file is an Eclipse
> >> artifact).  I would dearly love to have this capability in Emacs.
> >>
> >> Have either of the other two Java developers who use Emacs done this
> >> perchance?  :-)  I'm guessing not.
> >>
> >> Assuming it does not exist, I'd be inclined to create a Java
> >> application to run in the background which provides an IPC mechanism
> >> to talk to Emacs Lisp.  Then I would develop "features" in this proxy
> >> app for Emacs that are more natural to implement in Java.  I'm
> >> guessing that a "daemon" type app is better than a typical Unix tool
> >> approach (because of painful start-up latencies that won't likely be
> >> solved for a few years ubiquitously)
> >>
> >> Anyone feel this is just a totally wrong way to go to solve the
> >> problem?
> >>
> >> -pmr
> > 
> > 
> > Why not try to ask this on the JDEE developers list?
> 
> Seems like a reasonable idea...
> 
> But I will, against my better judgment, make the observation that JDEE 
> is pretty much "stuck" and that I have had a lot of problems trying to 
> ever find a stable combination of repository based Emacs AND some flavor 
> of JDEE so I pretty much abandoned JDEE, Paul's excellent work 
> notwithstanding.  Should JDEE become unstuck, I'll revisit making it 
> work with the Emacs development code.
> 
> -pmr

Try this in your .emacs file:

(defun jde-import-fixit ()
  "Combines jde-import-all, jde-import-kill-extra-imports and
jde-import-organize into one easy function call.  Emulates
eclipse's CTRL-SHIFT-O."
  (interactive)
  (jde-import-all)
  (jde-import-kill-extra-imports)
  (jde-import-organize)
  (save-buffer))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]