Subject: bug#61943: 29.0.60; icomplete--in-region-setup should activate icomplete-fido-mode-map too

From: João Távora <[email-masked]>
Date: Wed, 22 Mar 2023 18:43:51 +0000

Sean Whitton <[email-masked]> writes:

> Hello,
>
> On Tue 21 Mar 2023 at 11:40PM GMT, João Távora wrote:
>
>> Yes you may, but no, I haven't.  Icomplete and Fido and cousins,
>> it's true.  But icomplete-in-buffer wasn't around (at least wasn't
>> in any way functional) when Fido was born.  So I don't have
>> any plans of integrating this part of icomplete in Fido, because
>> it's not really how I envision Fido being used for non-minibuffer
>> completion.
>>
>> I have other plans for a future fido-in-buffer where
>> the feedback overlay -- in horizontal or vertical form -- shows
>> in the echo area instead.
>
> Interesting idea.  What do you think the advantages are?  It's breaking
> with how such things usually work, in Emacs and in other editors.

I wouldn't call it breaking, it's just a different UI.  Fido modes
(fido-mode and fido-vertical-mode) work in the minibuffer which shares
its display space with the echo area already, so I wouldn't think it's
that odd.

> Since you're up for reviewing a patch to make icomplete-in-buffer work
> with fido-mode, I assume you are interested in keeping both working?

As I said, only if an elegant enough patch can be devised for the
current icomplete-in-buffer functionality.

>> That said, if a simple patch to make icomplete-in-buffer work with
>> fido-mode can be achieved, I have no problem reviewing it.
>> As you suggested, it could be as simple as integrating
>> icomplete--fido-mode-setup into icomplete--in-region-setup.
>> But that is relatively tricky as whatever variables are set
>> when entering this mode but be properly reset when leaving it.
>> Doing this elegantly might not be hard, but it's not trivial
>> either.
>
> Currently icomplete--in-region-setup sets completion-show-inline-help
> locally and then unconditionally kills that local variable.  So we could
> do the same for fido-mode's variables, but is it possible that a major
> mode might want to set one of them?
>
> Otherwise, if there is to be some mechanism for restoring old
> buffer-local values, then we should use it for
> completion-show-inline-help too.

Yes, that's what's needed.  "killing the variable" isn't the right
approach since that erases a pre-override buffer-local setting.

João