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

Previous Next

Package: emacs;

Reported by: Vasilij Schneidermann <v.schneidermann <at> gmail.com>

Date: Sat, 28 Jan 2017 11:04:01 UTC

Severity: minor

Merged with 25986

Found in versions 25.1, 25.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25561 in the body.
You can then email your comments to 25561 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25561; Package emacs. (Sat, 28 Jan 2017 11:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vasilij Schneidermann <v.schneidermann <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 28 Jan 2017 11:04:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vasilij Schneidermann <v.schneidermann <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while
 let-bound!" warning with Evil
Date: Sat, 28 Jan 2017 12:03:31 +0100
Hello,

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.

[1]: https://github.com/emacs-evil/evil/issues/748
[2]: https://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00903.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25561; Package emacs. (Sun, 29 Jan 2017 00:52:02 GMT) Full text and rfc822 format available.

Message #8 received at 25561 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Vasilij Schneidermann <v.schneidermann <at> gmail.com>
Cc: 25561 <at> debbugs.gnu.org
Subject: Re: bug#25561: 25.1;
 "Making isearch-search-fun-function local to *Minibuf-1* while
 let-bound!" warning with Evil
Date: Sun, 29 Jan 2017 02:39:53 +0200
> Hello,
>
> 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.
>
> [1]: https://github.com/emacs-evil/evil/issues/748
> [2]: https://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00903.html

Thanks for the report.  I'm not familiar with the Evil package,
so please correct me if I make wrong guesses about it.  I suppose
that the basic mode of operation of the Evil package is not buffer-local.
In this case I believe (make-local-variable 'isearch-search-fun-function)
is the wrong fix because it will make this variable have this value
in every random buffer where the user happens to invoke the search command.

OTOH, if evil-mode is the global mode then it makes sense to change the
global value of isearch-search-fun-function (and perhaps keeping its
old value).  If you need to keep standard search commands working,
then you could create a new internal defvar e.g. evil-search-is-active,
set it temporarily in evil-search commands, and check it in your new
implementation of the search function in isearch-search-fun-function.
If evil-search-is-active is nil, then call the old default value
isearch-search-fun-default.

I can't guarantee this solution to work, it's just an idea for you
to consider.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25561; Package emacs. (Sun, 29 Jan 2017 12:26:02 GMT) Full text and rfc822 format available.

Message #11 received at 25561 <at> debbugs.gnu.org (full text, mbox):

From: Vasilij Schneidermann <v.schneidermann <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 25561 <at> debbugs.gnu.org
Subject: Re: bug#25561: 25.1; "Making isearch-search-fun-function local to
 *Minibuf-1* while let-bound!" warning with Evil
Date: Sun, 29 Jan 2017 13:25:24 +0100
> Thanks for the report.  I'm not familiar with the Evil package, so
> please correct me if I make wrong guesses about it.  I suppose that
> the basic mode of operation of the Evil package is not buffer-local.

It's a bit trickier than that.  Evil defines a minor mode
(evil-local-mode), then a global minor mode (evil-mode) using it and a
few more variables for state tracking.  The supported mode of operation
is therefore global, while still allowing to deactivate it on a
per-buffer or even per-command basis (there's a command to deactivate
Evil's keymaps for the duration of the next command).

> OTOH, if evil-mode is the global mode then it makes sense to change
> the global value of isearch-search-fun-function (and perhaps keeping
> its old value).  If you need to keep standard search commands working,
> then you could create a new internal defvar e.g.
> evil-search-is-active, set it temporarily in evil-search commands, and
> check it in your new implementation of the search function in
> isearch-search-fun-function.  If evil-search-is-active is nil, then
> call the old default value isearch-search-fun-default.

Hm, this sounds hackier than the current approach, also, what if another
package let-binds this variable for custom search functionality?  The
reason I reported this warning is because I suspect something about
isearch and the minibuffer setup hook isn't done correctly, in hope of
getting rid of the warning for every user of that variable.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25561; Package emacs. (Wed, 08 Feb 2017 12:56:01 GMT) Full text and rfc822 format available.

Message #14 received at 25561 <at> debbugs.gnu.org (full text, mbox):

From: Vasilij Schneidermann <v.schneidermann <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 25561 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#25561: 25.1; "Making isearch-search-fun-function local to
 *Minibuf-1* while let-bound!" warning with Evil
Date: Wed, 8 Feb 2017 13:55:23 +0100
Bumping this thread to CC Stefan Monnier as well.

On 01/29/17 at 02:39am, Juri Linkov wrote:
> > Hello,
> >
> > 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.
> >
> > [1]: https://github.com/emacs-evil/evil/issues/748
> > [2]: https://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00903.html
> 
> Thanks for the report.  I'm not familiar with the Evil package,
> so please correct me if I make wrong guesses about it.  I suppose
> that the basic mode of operation of the Evil package is not buffer-local.
> In this case I believe (make-local-variable 'isearch-search-fun-function)
> is the wrong fix because it will make this variable have this value
> in every random buffer where the user happens to invoke the search command.
> 
> OTOH, if evil-mode is the global mode then it makes sense to change the
> global value of isearch-search-fun-function (and perhaps keeping its
> old value).  If you need to keep standard search commands working,
> then you could create a new internal defvar e.g. evil-search-is-active,
> set it temporarily in evil-search commands, and check it in your new
> implementation of the search function in isearch-search-fun-function.
> If evil-search-is-active is nil, then call the old default value
> isearch-search-fun-default.
> 
> I can't guarantee this solution to work, it's just an idea for you
> to consider.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25561; Package emacs. (Wed, 08 Feb 2017 22:22:02 GMT) Full text and rfc822 format available.

Message #17 received at 25561 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Vasilij Schneidermann <v.schneidermann <at> gmail.com>
Cc: 25561 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#25561: 25.1;
 "Making isearch-search-fun-function local to *Minibuf-1* while
 let-bound!" warning with Evil
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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25561; Package emacs. (Fri, 10 Feb 2017 10:17:02 GMT) Full text and rfc822 format available.

Message #20 received at 25561 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 25561 <at> debbugs.gnu.org, v.schneidermann <at> gmail.com, juri <at> linkov.net
Subject: Re: bug#25561: 25.1;
 "Making isearch-search-fun-function local to *Minibuf-1* while
 let-bound!" warning with Evil
Date: Fri, 10 Feb 2017 12:16:32 +0200
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> Date: Wed, 08 Feb 2017 17:21:11 -0500
> Cc: 25561 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
> 
> >> > 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.

So you are saying we should remove that warning entirely?

What about the other warning, "Making FOO buffer-local while let-bound!"?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25561; Package emacs. (Fri, 10 Feb 2017 12:46:02 GMT) Full text and rfc822 format available.

Message #23 received at 25561 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25561 <at> debbugs.gnu.org, v.schneidermann <at> gmail.com, juri <at> linkov.net
Subject: Re: bug#25561: 25.1;
 "Making isearch-search-fun-function local to *Minibuf-1* while
 let-bound!" warning with Evil
Date: Fri, 10 Feb 2017 07:45:53 -0500
> So you are saying we should remove that warning entirely?

Yes.

> What about the other warning, "Making FOO buffer-local while let-bound!"?

IIRC this one is less annoying, but it didn't prove useful either, so
I thing we should remove it as well.


        Stefan




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 18 Feb 2017 09:30:02 GMT) Full text and rfc822 format available.

Notification sent to Vasilij Schneidermann <v.schneidermann <at> gmail.com>:
bug acknowledged by developer. (Sat, 18 Feb 2017 09:30:03 GMT) Full text and rfc822 format available.

Message #28 received at 25561-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 25561-done <at> debbugs.gnu.org, v.schneidermann <at> gmail.com, juri <at> linkov.net
Subject: Re: bug#25561: 25.1;
 "Making isearch-search-fun-function local to *Minibuf-1* while
 let-bound!" warning with Evil
Date: Sat, 18 Feb 2017 11:29:47 +0200
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> Cc: v.schneidermann <at> gmail.com, 25561 <at> debbugs.gnu.org, juri <at> linkov.net
> Date: Fri, 10 Feb 2017 07:45:53 -0500
> 
> > So you are saying we should remove that warning entirely?
> 
> Yes.
> 
> > What about the other warning, "Making FOO buffer-local while let-bound!"?
> 
> IIRC this one is less annoying, but it didn't prove useful either, so
> I thing we should remove it as well.

Done.




Forcibly Merged 25561 25986. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 05 Mar 2017 22:31:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Apr 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.