From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Is intellisense features integration in Emacs technically possible? Date: Sun, 26 Jan 2014 01:42:42 +0200 Message-ID: <877g9n1vd9.fsf@yandex.ru> 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 X-Trace: ger.gmane.org 1390693381 11837 80.91.229.3 (25 Jan 2014 23:43:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Jan 2014 23:43:01 +0000 (UTC) Cc: phillip.lord@newcastle.ac.uk, emacs-devel@gnu.org, Jorgen Schaefer To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 26 00:43:08 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 1W7CsT-0003kX-Bd for ged-emacs-devel@m.gmane.org; Sun, 26 Jan 2014 00:43:05 +0100 Original-Received: from localhost ([::1]:52924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7CsS-0006Hc-Th for ged-emacs-devel@m.gmane.org; Sat, 25 Jan 2014 18:43:04 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7CsK-0006GQ-Ly for emacs-devel@gnu.org; Sat, 25 Jan 2014 18:43:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7CsF-0008CT-7S for emacs-devel@gnu.org; Sat, 25 Jan 2014 18:42:56 -0500 Original-Received: from mail-ea0-x22c.google.com ([2a00:1450:4013:c01::22c]:63549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7CsE-0008CN-Vs for emacs-devel@gnu.org; Sat, 25 Jan 2014 18:42:51 -0500 Original-Received: by mail-ea0-f172.google.com with SMTP id g15so1642109eak.3 for ; Sat, 25 Jan 2014 15:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=TefLVzInAU1a4yvLbBi5rwUaFMgsSuLXj4OfgziPGjk=; b=ouZ1hm7zoPJ7nKSkT80G0TC3RbrjUR4LckPaks0LhCNzgqI51cOGjkLQ8UAWH06sqO 2Kb2vAhqFviA1HdYREXD4WWumh6GUXCvNPk7VxtgRD0PN8QyaK4KMbOdyulAJNJiGJ1G ePG7oSlNZCiP/gqwyAkeN0iApbtmFPQI1r/nyaJocm7YNheetd4qU0mjYbFWBf4WcX9e ypRMZof0pkXBdQDZ99nj1PRWVoQK/HVkcpX8ZXRbRojkgJb7n/eABl3OgiXXydKxSAi0 E6qjuXkXyHpcIRqCjrx0kKYP2rHqvtxw3ePdryODzMUXDRK6yLwrpeVGxlWpWP0NL/P3 cEmg== X-Received: by 10.15.111.6 with SMTP id ci6mr14830216eeb.59.1390693369956; Sat, 25 Jan 2014 15:42:49 -0800 (PST) Original-Received: from axl (213-173-121.netrunf.cytanet.com.cy. [213.7.173.121]) by mx.google.com with ESMTPSA id g1sm21720280eet.6.2014.01.25.15.42.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 25 Jan 2014 15:42:49 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Thu, 23 Jan 2014 20:40:36 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22c 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:169096 Archived-At: Stefan Monnier writes: > 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. Note that a backend that works asynchronously will probably fetch every kind of data asynchronously, i.e. not only the list of completions, but also their annotations, location, etc. (though completion-at-point only supports :annotation, so I mostly mean :company- properties here). This kind of API would easier to implement in the company-backends, because all actions are treated equally there. So we could support something like ('async . (lambda (cont) ...)) as return value for any action. Except for `prefix', I guess, because that would be weird. And most of the actions, except `candidates' would still work synchronously to the user's eye, because they are triggered by explicit user actions. Still, this would save backend implementers from writing code like `(while (eq value 'trash) (sit-for 0.01))' each time.