Subject: Re: bug#12690: 24.2; [FEATURE REQUEST] Make :annotation-function more flexible

From: Stefan Monnier <[email-masked]>
Date: Mon, 22 Oct 2012 21:51:27 -0400

severity 12690 wishlist
thanks

> In a modern decent IDE, completion annotation is a great help in finding
> the right completion candidate especially when the collection is large.
> See the attached screenshot, it uses color and letter to help users
> identify the type of completion they are looking for. Emacs is rather
> limited in this regard. It seems something can be achieved by allowing
> :annotation-function to return the WHOLE thing to be displayed in the
> *Completions* buffer.

I agree we need to make it possible to provide a richer display.
E.g. popup-help on each entry, or even more extended help in *Help* by
pressing a particular key.
In your image you show text prepended before each entry as well, which
can be also be useful.  But note that prepending text requires accessing
the complete completion list, so as to know how much space to leave to
align all entries.
Furthermore, how to display such text might depend on the UI you use
(e.g. you can prepend the text without affecting the actual textual
content of the completion buffer with an overlay or text-properties,
but that won't work if the completion is displayed as a GUI menu, so
I think we'd need the new annotation function to return a "high-level"
description so the UI code can then choose which trick to use to display
that data).

        Stefan