I haven't ever seriously used jde-complete b/c it didn't quite work
(Xemacs, linux) and I could be bothered to find out why.  Well, I
finally looked closer and believe I've found the reason.  

Symptoms:

The problem was that it wouldn't cycle through the possible completions:
instead it would emit a not-very-useful stub which I would then have
to edit.  Also, it complained about an eldoc function not being defined.

so,

java.util.List l = new ArrayList();
l.i[M-x jde-complete-at-point] ===> l.indexOf(java.lang.Object : int);

&& a message about problems with eldoc.

Diagnosis:

The jde-complete.el source has this in it:

;;jde-eldoc for completion signatures
(eval-when-compile (require 'eldoc)
                   (require 'senator))

This makes it possible to compile jde-complete.el to jde-complete.elc.
BUT, there's no runtime (require 'eldoc) anywhere in the JDE.  Since I
don't use eldoc (which is part of (x)emacs) in any of my other emacs
stuff, eldoc never gets loaded, and jde-complete's references to eldoc
code do not work.  Hence, jde-complete does not work.

I don't know much about eval-when-compile, but I'm guessing that it
does get evaluated when you load jde-complete from the .el file 
(as opposed to a byte-compiled .elc file).  If this is true, it would
explain why this code might work for those who do not byte compile the
JDE, yet fail for those who do.  [I'm speculating - I haven't looked into
this at all.]

At any rate, since semantic is a requirement for the JDE and since eldoc
is part of (x)emacs, I propose dropping the 'eval-when-compile' bit and
just having plain old 

(require 'eldoc)
(require 'senator)

With this minor change, jde-complete works as advertised and has become
a very handy tool!

Eric

Reply via email to