bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#66948: [PATCH] Add Completion Preview mode


From: Eshel Yaron
Subject: bug#66948: [PATCH] Add Completion Preview mode
Date: Wed, 15 Nov 2023 15:22:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> > Alternatively, we could have a defcustom based on a different design:
>> > show preview only when there are fewer than N completion candidates,
>> > with N being customizable.  That would make much more sense, IMO,
>> > since it replaces a largely "mechanical" limitation with one that is
>> > meaningful for users.
>> 
>> That would indeed be a nice solution, but it has a fatal flaw, sadly.
>> Computing the set of completion candidates is a costly operation,
>> especially with backends such as LSP, so we don't want to do that after
>> each command.
>
> This seems to be an argument in favor of the timer-based design I
> suggested.  But if you aren't inclined to do that, I guess we can
> install the feature as it is designed now.

That'd be great, thanks.

>> >> > The underline face is not universally supported, so this defface
>> >> > should have fallbacks.
>> >>
>> >> The `underline` face in faces.el has `:underline t` in the fallback
>> >> clause too, so I figured that should be alright, no?
>> >
>> > If you are okay with seeing no effect at all when the terminal doesn't
>> > support the underline attribute, then yes.  But I thought we want this
>> > face to stand out no matter what, don't we?
>> 
>> That's okay IMO, the underline just differentiates between when you have
>> a single candidate and when you have multiple candidates.  I don't think
>> that's that crucial, but if you can suggest a universally supported
>> fallback I'd be glad to add it, of course.
>
> How about some color (foreground or background)?

Sure, I've added a fallback that uses `:weight bold` when that's
supported but `:underline` isn't, and another ultimate fallback that
uses a background color instead.  Here's the updated patch (v6):

Attachment: v6-0001-Add-Completion-Preview-mode.patch
Description: Text Data


reply via email to

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