Subject: Re: bug#25561: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while let-bound!" warning with Evil

From: Stefan Monnier <[email-masked]>
Date: Wed, 08 Feb 2017 17:21:11 -0500

>> > a user of the Evil package reported [1] that using a search command
>> > results in a "Making isearch-search-fun-function local to *Minibuf-1*
>> > while let-bound!" warning.  This appears to be an interaction between
>> > isearch and Evil, more specifically, Evil let-binds
>> > `isearch-search-fun-function' to something of its own, invokes isearch
>> > and something in isearch ends up running
>> > `minibuffer-history-isearch-setup' which `make-local-variable' to have
>> > `isearch-search-fun-function' have a separate value, resulting in the
>> > aforementioned warning.
>> >
>> > What's the recommended way to avoid or silence it?  Stefan suggested
>> > elsewhere [2] that this might indicate a bug, hence why I'm bringing
>> > this up here.

I plead guilty of adding this warning.  But FWIW, I think it was
misguided: the interaction between make-local-variable and let-binding
can be pretty tricky, which is why I added the warning (thinking that
such things should better be avoided), but in my subsequent experience,
I haven't found a single case where the problem is real.  Worse: it's
often difficult/ugly to change the code to avoid the "tricky"
interaction, because the code that does the let-binding doesn't know
about the other and vice-versa.

So, while the trickiness rmains, I think it's best to just hope for the
best, silently, rather than signal a warning that nobody (not even me)
knows how to address satisfactorily.

        Stefan