Subject: Re: bug#72229: (setq overriding-terminal-local-map nil) in isearch-done

From: Michael Heerdegen <[email-masked]>
Date: Mon, 22 Jul 2024 14:49:34 +0200

Michael Heerdegen via "Bug reports for GNU Emacs, the Swiss army knife
of text editors" <[email-masked]> writes:

> exiting isearch always explicitly sets `overriding-terminal-local-map'
> to nil.  This will interfere with any other users of
> `overriding-terminal-local-map', including any active transient maps.
>
> Wouldn't a less radical means suffice?  If isearch really must _set_,
> i.e., completely override that variable, why not restore the original
> value?

Juri, what's your opinion on this?

A little more forward looking:

In such situations I often get this thought: if the variable was
replaced with a function accepting zero arguments, then we could use
`add-function' and `remove-function' to control the return value of the
"binding".

I know the advice mechanism has the reputation of only being suitable
for end user customization/hacks, but in cases like this one we could
make the modification of the value more explicit and controllable.
Dealing with interferences would be forced to be taken into account more
directly , and we would get some useful mechanisms like priorities or
looking at the context out of the box.

We could also invent some even better mechanism, maybe.  But in this
case binding variables doesn't look like an optimal approach at least.

Michael.