emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs completion matches selection UI


From: Toby Cubitt
Subject: Re: Emacs completion matches selection UI
Date: Mon, 30 Dec 2013 20:47:56 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Sorry to arrive late to the party :-)

Ted Zlatanov <tzz <at> lifelogs.com> writes:
> On Mon, 23 Dec 2013 08:42:51 -0500 Stefan Monnier <monnier <at>
IRO.UMontreal.CA> wrote: 
> OK, I'll move on.  If the new UI proves compelling, users will tell us
> they want it supported in their favorite modes :)
> 
> >> As with company-mode, this can be a frontend choice (affecting
> >> `display-completion-list', and see below for the suggested
> >> `display-list' function).  How about a defcustom
> >> `completion-ui-frontend' with some choices?
> 
> SM> The general idea of completion-ui was great, yes.
> 
> >> For the user, a new defcustom `completion-ui-preferences'?  And for the
> >> caller, some kind of plist/alist passed to `completion-at-point' that
> >> merges cleanly with `completion-ui-preferences'?
> 
> SM> Could be.  Tho as mentioned before, I'm not sure that there's a need for
> SM> caller-provided preferences.
> 
> OK, I'll work on this off-list to keep the noise down, I've generated
> enough emacs-devel traffic so far!
> 
> Dmitry, Stephen, please let me know directly if you want to participate
> in the design of `completion-ui-*' as described here.  I honestly can't
> keep track of all the completion packages available, but I'm
> xposting/CC-ing the Helm developers, and Toby Cubitt (because of
> http://www.emacswiki.org/emacs/CompletionUI the prefix "completion-ui"
> may need to be changed, but it seems to have similar ideas to the
> frontends we're describing here).

I'm wondering how much of what you're planning has already been coded
long ago in completion-UI, which already:

- has completely modularised completion user-interfaces, which can be
  used in any combination the user likes (within reason)

- 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...

- lets you add a new completion UI with a single call to the
  `completion-ui-register-interface' macro

- has completely modularised completion sources (similar to company-mode,
  anything.el, auto-complete-mode, etc.)

- lets you register a new completion source with a single call to the
  `completion-ui-register-source' macro

- defines an `auto-completion-mode' (essentially, a more advanced version
  of auto-complete.el) that works with any completion source

- lets users customize their completion UIs at as fine-grained a level as
  they want: globally, separately for different completion sources, or
  (of course) per-major-mode etc. as usual

I haven't had time to read the whole thread, but from what I've skimmed
through so far it looks like much what you're discussing is already implemented.

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.

Many years ago (pre-Stefan's tenure), I had an email discussion with
Richard Stallman about getting completion-UI into a state to be added to
Emacs, precisely to be a richer generic completion user interface for
Emacs. Richard pronounced himself "happy" at the end of the discussion, but
then he moved on to other things and I got busy with academic work, and it
never happened.

If you're interested in exploring how much is already there to be reused
or adapted, I'm happy to help (to the extent that my "real" work allows).

All the best,
Toby

PS: If it ever came to that point, I already have copyright papers on
file with the FSF, so donating most of the completion-UI code would be
straightforward. 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. But since the UIs are completely modular,
in the worst case that UI could be left out initially, and reimplemented
later.
-- 
Dr T. S. Cubitt
Royal Society University Research Fellow
and Fellow of Churchill College, Cambridge
Centre for Quantum Information
DAMTP, University of Cambridge

email: address@hidden
web:   www.dr-qubit.org







reply via email to

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