emacs-devel
[Top][All Lists]
Advanced

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

Re: Inline completion preview


From: Eshel Yaron
Subject: Re: Inline completion preview
Date: Wed, 01 Nov 2023 11:44:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

João Távora <joaotavora@gmail.com> writes:

> On Wed, Nov 1, 2023 at 8:30 AM Eshel Yaron <me@eshelyaron.com> wrote:
>
>> > I can imagine that this behavior can be useful for certain personal
>> > habits/used languages/etc, but it's a change from the default.
>>
>> I agree, although the user explicitly enables this minor mode, so it's [not]
>> entirely unexpected for it to change an otherwise default behavior, no?
>
> Yes, this makes some sense, especially since as far as I understand it,
> this minor mode is really about "changing the default behaviour of
> C-M-i".
>
> But OTOH there are other better ways to do that, i.e. via
> completion-at-point-functions.   Are you sure your completion frontend
> can't work via those?  The function you add to that variable could
> just endeavour to check if there's any preview showing as an overlay,
> and it if is insert it.  Then you would need no rebinding.

Yes, that could be quite a nice solution.  I'll try working it in and
see how it goes.  Thanks for this suggestion.

> Also are you 100% sure Company doesn't do this?  I'm pretty sure
> it does this when there is only one completion, at least.

No, I'm sure Company does do more or less this.  As you say, and as I
mentioned upthread, Company provides a preview frontend that kicks in
when there's just one completion candidate by default.  (This is in
contrast with `corfu`, that provides no such preview.)  There are some
differences between my implementation and what you get with Company's
preview frontend, but if Company would make it to core Emacs that would
indeed mostly obviate the need for my `completion-preview`, at least as
far as I'm concerned.  Is there a viable path for upstreaming Company?




reply via email to

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