From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@newcastle.ac.uk (Phillip Lord) Newsgroups: gmane.emacs.devel Subject: Re: Is intellisense features integration in Emacs technically possible? Date: Thu, 23 Jan 2014 13:20:50 +0000 Message-ID: <87fvoedebx.fsf@newcastle.ac.uk> References: <1390269670.2888.14.camel@localhost.localdomain> <83zjmpf80o.fsf@gnu.org> <877g9shqms.fsf@newcastle.ac.uk> <20140122194930.49ba60be@forcix.kollektiv-hamburg.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1390483282 3799 80.91.229.3 (23 Jan 2014 13:21:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Jan 2014 13:21:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jorgen Schaefer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 23 14:21:29 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W6KDk-0007aR-3b for ged-emacs-devel@m.gmane.org; Thu, 23 Jan 2014 14:21:24 +0100 Original-Received: from localhost ([::1]:41052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6KDj-0005qE-Je for ged-emacs-devel@m.gmane.org; Thu, 23 Jan 2014 08:21:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6KDd-0005lm-0j for emacs-devel@gnu.org; Thu, 23 Jan 2014 08:21:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6KDX-00010x-2h for emacs-devel@gnu.org; Thu, 23 Jan 2014 08:21:16 -0500 Original-Received: from cheviot22.ncl.ac.uk ([128.240.234.22]:35918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6KDW-00010q-Ql for emacs-devel@gnu.org; Thu, 23 Jan 2014 08:21:11 -0500 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129]) by cheviot22.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1W6KDV-0005jt-G6; Thu, 23 Jan 2014 13:21:10 +0000 Original-Received: from localhost (jangai.ncl.ac.uk [10.66.67.223]) (authenticated bits=0) by smtpauth-vm.ncl.ac.uk (8.13.8/8.13.8) with ESMTP id s0NDL94J015967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 23 Jan 2014 13:21:09 GMT In-Reply-To: <20140122194930.49ba60be@forcix.kollektiv-hamburg.de> (Jorgen Schaefer's message of "Wed, 22 Jan 2014 19:49:30 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:168949 Archived-At: Jorgen Schaefer 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. Phil