* bug#25561: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while let-bound!" warning with Evil @ 2017-01-28 11:03 Vasilij Schneidermann [not found] ` <8760kyzoma.fsf@mail.linkov.net> 0 siblings, 1 reply; 7+ messages in thread From: Vasilij Schneidermann @ 2017-01-28 11:03 UTC (permalink / raw) To: 25561 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <8760kyzoma.fsf@mail.linkov.net>]
* bug#25561: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while let-bound!" warning with Evil [not found] ` <8760kyzoma.fsf@mail.linkov.net> @ 2017-01-29 12:25 ` Vasilij Schneidermann 2017-02-08 12:55 ` Vasilij Schneidermann 1 sibling, 0 replies; 7+ messages in thread From: Vasilij Schneidermann @ 2017-01-29 12:25 UTC (permalink / raw) To: Juri Linkov; +Cc: 25561 > 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#25561: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while let-bound!" warning with Evil [not found] ` <8760kyzoma.fsf@mail.linkov.net> 2017-01-29 12:25 ` Vasilij Schneidermann @ 2017-02-08 12:55 ` Vasilij Schneidermann 2017-02-08 22:21 ` Stefan Monnier 1 sibling, 1 reply; 7+ messages in thread From: Vasilij Schneidermann @ 2017-02-08 12:55 UTC (permalink / raw) To: Juri Linkov; +Cc: 25561, Stefan Monnier 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#25561: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while let-bound!" warning with Evil 2017-02-08 12:55 ` Vasilij Schneidermann @ 2017-02-08 22:21 ` Stefan Monnier 2017-02-10 10:16 ` Eli Zaretskii 0 siblings, 1 reply; 7+ messages in thread From: Stefan Monnier @ 2017-02-08 22:21 UTC (permalink / raw) To: Vasilij Schneidermann; +Cc: 25561, Juri Linkov >> > 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#25561: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while let-bound!" warning with Evil 2017-02-08 22:21 ` Stefan Monnier @ 2017-02-10 10:16 ` Eli Zaretskii 2017-02-10 12:45 ` Stefan Monnier 0 siblings, 1 reply; 7+ messages in thread From: Eli Zaretskii @ 2017-02-10 10:16 UTC (permalink / raw) To: Stefan Monnier; +Cc: 25561, v.schneidermann, juri > From: Stefan Monnier <monnier@IRO.UMontreal.CA> > Date: Wed, 08 Feb 2017 17:21:11 -0500 > Cc: 25561@debbugs.gnu.org, Juri Linkov <juri@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!"? ^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#25561: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while let-bound!" warning with Evil 2017-02-10 10:16 ` Eli Zaretskii @ 2017-02-10 12:45 ` Stefan Monnier 2017-02-18 9:29 ` Eli Zaretskii 0 siblings, 1 reply; 7+ messages in thread From: Stefan Monnier @ 2017-02-10 12:45 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 25561, v.schneidermann, juri > 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#25561: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while let-bound!" warning with Evil 2017-02-10 12:45 ` Stefan Monnier @ 2017-02-18 9:29 ` Eli Zaretskii 0 siblings, 0 replies; 7+ messages in thread From: Eli Zaretskii @ 2017-02-18 9:29 UTC (permalink / raw) To: Stefan Monnier; +Cc: 25561-done, v.schneidermann, juri > From: Stefan Monnier <monnier@IRO.UMontreal.CA> > Cc: v.schneidermann@gmail.com, 25561@debbugs.gnu.org, juri@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. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-02-18 9:29 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-01-28 11:03 bug#25561: 25.1; "Making isearch-search-fun-function local to *Minibuf-1* while let-bound!" warning with Evil Vasilij Schneidermann [not found] ` <8760kyzoma.fsf@mail.linkov.net> 2017-01-29 12:25 ` Vasilij Schneidermann 2017-02-08 12:55 ` Vasilij Schneidermann 2017-02-08 22:21 ` Stefan Monnier 2017-02-10 10:16 ` Eli Zaretskii 2017-02-10 12:45 ` Stefan Monnier 2017-02-18 9:29 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).