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: Emacs completion matches selection UI Date: Tue, 31 Dec 2013 18:30:47 +0400 Message-ID: <877gal5bzc.fsf@yandex.ru> References: <87fvqtg02v.fsf@flea.lifelogs.com> <87eh5bkxca.fsf@flea.lifelogs.com> <87d2kuzzqj.fsf@uwakimon.sk.tsukuba.ac.jp> <87a9fylusq.fsf@flea.lifelogs.com> <878uvizrwz.fsf@uwakimon.sk.tsukuba.ac.jp> <8761qmkyn1.fsf@flea.lifelogs.com> <87zjnyxdpb.fsf@uwakimon.sk.tsukuba.ac.jp> <87k3f2j7xv.fsf@flea.lifelogs.com> <2518D79A-B9E4-45DF-A403-8330145DFD17@gmail.com> <87eh58j0x3.fsf@flea.lifelogs.com> <87mwjvfrfy.fsf@flea.lifelogs.com> <877gawbhp0.fsf@flea.lifelogs.com> <87pponagzs.fsf@flea.lifelogs.com> <871u13aabr.fsf@flea.lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388500260 19765 80.91.229.3 (31 Dec 2013 14:31:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 31 Dec 2013 14:31:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Toby Cubitt Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 31 15:31:07 2013 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 1Vy0Lb-0000Wh-CQ for ged-emacs-devel@m.gmane.org; Tue, 31 Dec 2013 15:31:07 +0100 Original-Received: from localhost ([::1]:33980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vy0Lb-0001gq-08 for ged-emacs-devel@m.gmane.org; Tue, 31 Dec 2013 09:31:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vy0LT-0001a2-FD for emacs-devel@gnu.org; Tue, 31 Dec 2013 09:31:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vy0LO-0006bP-Gg for emacs-devel@gnu.org; Tue, 31 Dec 2013 09:30:59 -0500 Original-Received: from mail-lb0-x231.google.com ([2a00:1450:4010:c04::231]:40609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vy0LO-0006bI-4N for emacs-devel@gnu.org; Tue, 31 Dec 2013 09:30:54 -0500 Original-Received: by mail-lb0-f177.google.com with SMTP id q8so6219174lbi.36 for ; Tue, 31 Dec 2013 06:30:52 -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=917BhMWJxKUykuV65PTvp31FUlp+v3rzPoKxTWSo2lI=; b=o5pq/ao/t94vnOBzd2pQ8sPocqvNWD1h7st+8uYF8SVe5aLO6rCFl1Jzczn7nj199E f9ThwNDzdOxD59egnpqaY7bnghqBVEXqD1OdPjT3QdIPMVkGLWHpAxZwfEsLwffCz+rj /9Xs0R5pywmtbyyoZ9HTh5eWEXmn0WDD65h7gnT+6yWSy1UfT17Nt/HPfhYgR+3noH/j oAiOJY1XewYeZO7E6gRpvq2bEkemh/PmakFU5H66CsKQ8we+7e38ssJ/yz44ncdiXyay KWEFQ8RlAE4uVVJ1mDMKgDHWFhkeZGhIiD85uHaTktdKHJKOQtin6OOfzLa4c7xIjZJQ auWQ== X-Received: by 10.112.53.201 with SMTP id d9mr26292629lbp.26.1388500252716; Tue, 31 Dec 2013 06:30:52 -0800 (PST) Original-Received: from axl ([178.252.98.87]) by mx.google.com with ESMTPSA id e10sm38772108laa.6.2013.12.31.06.30.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 31 Dec 2013 06:30:51 -0800 (PST) In-Reply-To: (Toby Cubitt's message of "Mon, 30 Dec 2013 20:47:56 +0000 (UTC)") 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:4010:c04::231 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:167012 Archived-At: Hello Toby, When I looked into the different completion interfaces available for Emacs, Completion-UI came out a lowest denominator in terms of features that can be supported by completion backends. Both Company and Auto-Complete support displaying candidate "summaries" (usually calltips and/or first line of the candidate's docstring), fuller documentation (in a new buffer, or in a popup, respectively), and Company also allows backends to return the candidate's location (as a position in a buffer or a line in a file), which has a respective "show definition" command. These are quite useful for programming. Completion-UI, from what I can tell, only considers candidates as strings to be inserted, without any introspection facilities. Even the Elisp source looks like this: (completion-ui-register-source all-completions :completion-args 1 :other-args (obarray) :name elisp :word-thing symbol) ...which is miles behind both `company-elisp' and `lisp-completion-at-point'. And because your source interface doesn't provide much, Completion-UI user-interfaces don't handle the extra options either. So, as things currently stand, if one was to write translation functions from Company backends and Auto-Complete sources, a whole slice of their features would be lost (see `company-backends' docstring for some details). Conversely, Company also provides swappable front-ends (see the docstring of `company-frontends'), so from where I stand, it should be easier to adapt any widgets you have implemented that we don't have as new Company front-ends. Toby Cubitt writes: > - has completely modularised completion user-interfaces, which can be > used in any combination the user likes (within reason) You can have some of that in Company by setting `company-frontends' to a buffer-local value. Probably. I've never tried that, though, and I'm not sure if I'll ever want to, personally. > - comes with all the UIs people usually ask for: in-buffer text > completion, tooltips (both real tooltips, and the "pop-up tip" > overlay-based tooltips), drop-down menus, pop-up mini-frames, list of > completions in echo area, hotkeys to select completions... Company doesn't have mini-frames and, I guess, drop-down menus. Is the latter a graphical menu that only allows interaction with mouse and arrow keys? > - lets you add a new completion UI with a single call to the > `completion-ui-register-interface' macro Company allows you to do that with a handy macro called `defun'. > - lets you register a new completion source with a single call to the > `completion-ui-register-source' macro Ditto. > Completion-UI isn't another company-mode or anything or auto-complete-mode. > It was always intended to be "plumbing": a generic completion user-interface > toolkit that other packages could use, to unify the interface for selecting > completions in Emacs. It would, I think, be rather easy to modify > company-mode, auto-complete-mode, anything.el, etc. to use completion-UI > instead of their built-in UI code. See above. It would be a lossy conversion. Also, I think `company-backends' provides a nicer API than `completion-ui-register-source'. > I use (a slightly modified version of) Tomohiro > Matsuyama's popup.el library for the overlay-based tooltips. I don't know > if Tomohiro has papers on file. It would be nice to be able to use it, but from what I see Matsuyama is not the sole significant contributor. I opened a related issue (https://github.com/auto-complete/popup-el/issues/50), but there's been no response so far. By the way, why are you bundling a modified version of popup.el instead of contributing the changes upstream?