[Top][All Lists]

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

Re: Is intellisense features integration in Emacs technically possible?

From: Phillip Lord
Subject: Re: Is intellisense features integration in Emacs technically possible?
Date: Thu, 23 Jan 2014 13:20:50 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Jorgen Schaefer <address@hidden> writes:
>> I think that it depends on the language. Introspecting over, for
>> example, Java would require an awful of elisp, which would be
>> difficult to write. Getting Java to do this work is quite a lot less
>> effort. Hence, the JDEEs use of Java for this (via bsh). Likewise,
>> Clojure and Scala both of which use their own language to do much of
>> the work. Or for that matter, common lisp with slime/swank. Or even,
>> for that matter, English with aspell. I didn't have a problem with
>> responsiveness with any of these.
> "External program" instead of "integrated" means very little these
> days. I wrote one of the various Emacs modes that provide semantic
> completion for Python, interfacing with two different Python libraries
> which do the actual semantic analysis. In this case, Emacs communicates
> with the external program via a specified protocol, which, from the
> Emacs side, looks exactly like calling some kind of Emacs Lisp
> function. (Abstraction is great.)

This also has the considerable advantage that it makes it possible to
physically separate the two; consider running ESS on your desktop and
the R process somewhere else.

> The only problem I have is that keeping state shared between the
> processes is difficult. Right now, what I'm doing is to re-send the
> current buffer to the other process, including the position of point,
> for every completion request. This is highly inefficient, and makes it
> difficult to create a tighter coupling for better completion or
> analysis from the Emacs side. To improve on that, there would need to
> be a way of sharing the current contents of a buffer with a subprocess
> without writing it to a file.

JDEE for java had that problem. Some operations required that files be
saved first or, even worse, compiled first.

Languages like clojure tend not to cause this problem, since their unit
of compilation is smaller (give or take, it's a function), so you just
send a string across the socket.

> It's mainly a common interface for such external programs so that we
> can add more languages more easily. The current effort of unifying the
> completion interface as well as supporting company mode as a front-end
> is going a great deal forward in that.

I'm not convinced that a single interface would work; again, using
clojure as example, this has moved away from a single interface in Emacs
(i.e. slime/swank) and toward a single interface for Clojure (so that
the Clojure side offers a single server, for different editors).

Having said that, there are definately utility functions that could
help. One problem with this strategy wrt Emacs is that it's single
threaded, but utilities for dealing with this such as generating
callbacks would help. No doubt closures will help here.

> The biggest problems are outside of Emacs. Good libraries that provide
> intelligent completion and code introspection are rare. 
> I know of three for Python, one of which is not maintained anymore,
> one was mostly-dead for a few years, and all of which have different
> deficiencies. They also have trouble keeping up with the development
> of the language. I expect similar problems for other languages.
> Reimplementing these libraries in Emacs Lisp will just cause more
> problems keeping them up-to-date.

I'm sure this is true. I don't know of any for Java.


reply via email to

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