Subject: Re: bug#73234: 30.0.91; completion-preview-mode doesn't trigger for case-insensitive capf

From: Eshel Yaron <[email-masked]>
Date: Fri, 20 Sep 2024 12:34:47 +0200

Morgan Willcock <[email-masked]> writes:

> Eshel Yaron <[email-masked]> writes:
>
>> If :exit-function doesn't work for your use case, please explain why,
>> and if there's indeed a need for another hook, it's easy to add one :)
>
> My reasons for not using :exit-function would be:

Thanks, these make sense.

> - If the completion was inserted using a different interface then the
>   function would be running unnecessarily.

Right, although this needn't be significant in terms of performance.

> - For completion functions that I didn't write, :exit-function isn't
>   going to be set with the expectation that a particular completion
>   interface and case preference is used to insert the candidate.

The idea is that you use a capf wrapper that adds the :exit-function,
when needed, like cape-capf-case-fold in your example.

> That said, I am just trying to think of an easy mechanism to preserve
> the case of the candidate.  A hook may generally be useful, but adding a
> hook does not solve the underlying problem that I am describing here.
>
> Perhaps it is best to just pause for the moment while you get additional
> feedback from other users.

All right, let me know if you have further thoughts or a potential patch,
and thank you for your engagement!

Best,

Eshel