GNU bug report logs -
#13250
24.3.50; Add a way to show pre-highlighted candidates in completions buffer
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Fri, 21 Dec 2012 19:44:02 UTC
Severity: wishlist
Found in version 24.3.50
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On 29.12.2012 9:29, Stefan Monnier wrote:
>> It would have to be a different function and metadata property, no?
>
> Could be.
>
>> I don't think we can change annotation-function to return the candidate plus
>> annotation, for example.
>
> Currently it can only return a string (which is combined with the
> completion into a cons cell), but we could let it return the cons cell
> directly. That wouldn't necessarily help with "annotations before" (and
> it wouldn't make sure that the annotations don't actually change
> the completions).
I decided not to do this for now, because it doesn't actually help in my
case. Or maybe I just haven't encountered a bug that would be caused by
the additional fontification (as long as I use 'face, not 'font-lock-face).
And the part below works the same, whether the base highlighting was
added in the completion strings directly, or through the annotation
function.
Speaking of "annotations before", I don't see how they can be used in
the current interface. Showing the classes where the methods are defined
would be good, but lining the candidates up vertically is important for
visual scan-ability, and the "before strings" can be of different lengths.
>> So, AFAICT, the proper solution would be to walk the part of the string,
>> look at every piece in it that has a different value of 'face, then where
>> the value is a symbol, wrap it into a list, and then add the new face to the
>> end of the lists. And repeat for the "first difference".
>
> Yes. Lars wanted to add a function that does just that, but you can use
> font-lock-prepend-text-property in the mean time.
Thanks, that was rather easy. I'm attaching a patch that fixes this
bug's problem for me (letting the fontifications through), so maybe we
should leave improvements to annotation function for later.
[completions-hl.diff (text/plain, attachment)]
This bug report was last modified 12 years and 80 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.