From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen Schaefer Newsgroups: gmane.emacs.devel Subject: Re: Is intellisense features integration in Emacs technically possible? Date: Fri, 24 Jan 2014 11:25:20 +0100 Message-ID: <20140124112520.7920a8cc@forcix.kollektiv-hamburg.de> References: <1390269670.2888.14.camel@localhost.localdomain> <83zjmpf80o.fsf@gnu.org> <877g9shqms.fsf@newcastle.ac.uk> <20140122194930.49ba60be@forcix.kollektiv-hamburg.de> <87fvoedebx.fsf@newcastle.ac.uk> <20140123215656.30bf63b8@forcix.kollektiv-hamburg.de> <20140123234321.26085e40@forcix.kollektiv-hamburg.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1390559139 3349 80.91.229.3 (24 Jan 2014 10:25:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jan 2014 10:25:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 24 11:25:47 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 1W6dxK-0000ex-RC for ged-emacs-devel@m.gmane.org; Fri, 24 Jan 2014 11:25:46 +0100 Original-Received: from localhost ([::1]:45526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6dxK-0004wV-AB for ged-emacs-devel@m.gmane.org; Fri, 24 Jan 2014 05:25:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6dxB-0004pq-7C for emacs-devel@gnu.org; Fri, 24 Jan 2014 05:25:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6dx1-0006Hs-DF for emacs-devel@gnu.org; Fri, 24 Jan 2014 05:25:37 -0500 Original-Received: from loki.jorgenschaefer.de ([87.230.15.51]:59128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6dx0-0006Hc-Tc for emacs-devel@gnu.org; Fri, 24 Jan 2014 05:25:27 -0500 Original-Received: by loki.jorgenschaefer.de (Postfix, from userid 998) id 3E3E1201369; Fri, 24 Jan 2014 11:25:25 +0100 (CET) Original-Received: from forcix.kollektiv-hamburg.de (x2f18b7a.dyn.telefonica.de [2.241.139.122]) by loki.jorgenschaefer.de (Postfix) with ESMTPSA id D1F99201367; Fri, 24 Jan 2014 11:25:22 +0100 (CET) In-Reply-To: X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; i486-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 87.230.15.51 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:169003 Archived-At: On Thu, 23 Jan 2014 20:40:36 -0500 Stefan Monnier wrote: > > I think there is currently no provision for the backend to return > > annotation information or documentation that complements the actual > > completions? > > Yes and no. The completion-at-point-functions can return any number > of extra properties, and Company uses that to let the backend provide > various extra info (see lisp-completion-at-point in a recent lisp.el > for an example). IOW you can provide as much extra info as is > currently supported by Company. Ok, that was what I was missing. Thank you. :-) > `completion-at-point-functions' has 2 "call levels": > - first level is: we call the functions on that hook to know if > there's a completion and (if there is) what kind of completion it is > (boundaries, completion-table, properties, ...). > - second level is: we call the completion-table to get the list > of candidates. > > Doing the second level asynchronously means to rewrite > partial-completion and friends in CPS. > > But maybe we can get by with only doing the first asynchronously. > IOW the first level could return an :async property which is a > function which you call with a continuation. That function will > contact some external process and when it's ready it will call the > continuation, passing it the real completion-table. And of course, > we'd need to make sure that non-async uses can also just wait for the > process to return the completion data. That sounds sensible. The asynchronous calls I use all return a list of possible completion candidates and where they start, which is more robust than auto-complete currently trying to identify the prefix with Emacs Lisp code. This response can then be used to construct the completion table without the need for any further asynchronous calls. Even documentation right now is returned by the initial asynchronous call and then cached for later use by auto-complete.el. I'm not sure about "returns an :async property which is called with a continuation". There does not seem to be a need to return a function which is called to run another function? Just letting the Emacs code know that we might add completions later and then calling some well-known function with additional completions once they are available would be sufficient I think? Jorgen