-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search causes warning about isearch-search-fun-function scope #748
Comments
Thanks for the bug report! I was initially skeptical of this as I couldn't find the warning in the Judging from some cursory sleuthing, the warning is an interaction of both Evil let-binding I'm not sure whether this issue can be solved in a meaningful way. Possible attempts:
@TheBB Thoughts? |
@wasamasa I agree, this is a very low-impact bug. In case it helps, I came across a commit in ggtags that claims to fix the same sort of issue, though I'm not sure I fully understand the mechanics of it. Also, this conversation seems to suggest a fix like, diff --git a/evil-search.el b/evil-search.el
index db5c604..13660a1 100644
--- a/evil-search.el
+++ b/evil-search.el
@@ -76,6 +76,7 @@ search module is used."
(defun evil-search-incrementally (forward regexp-p)
"Search incrementally for user-entered text."
+ (make-local-variable 'isearch-search-fun-function)
(let ((evil-search-prompt (evil-search-prompt forward))
(isearch-search-fun-function 'evil-isearch-function)
(point (point)) I tried that and it seemed to do the trick. I put in a PR (#750) with that change, but I'll defer to more experienced elispers as to whether this would have other, unintended consequences. |
Well, that thread also suggests that any interaction of that kind is a reason to report a bug. This makes a lot of sense, why would the docstring of In other words, I will not merge your PR for now and report a bug instead. |
@wasamasa Would you prefer I close the PR or wait to see if anything comes of the bug report? |
Please wait for at least a few days and give them a chance to respond. |
Will do, thanks. |
I've CC'd Stefan today and, well, see for yourself: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25561#17 Reads to me as if it's not worth bothering. |
sounds like he is considering removing the warning in a future emacs version, but he does not give any certainty about that. |
Wow, I didn't expect this bug to result in the complete removal of that class of warnings: http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=73ea77c856ded90cfb1a03a9d87827b5ecb93a7c This means both this bug and the PR can be closed. Thanks for making this happen, @ivanbrennan! |
Upon starting Emacs in evil-mode, the first time I attempt a search (
/
), accessing the search history (M-p
) causes a warning to display in the echo area:Subsequent searches are unaffected. If the first search doesn't try to access search history, it too is unaffected.
I was able to repro with a minimal init.el
and the following steps:
/
M-p
If I enable
evil-mode
manually instead of viaafter-init-hook
, the warning never appears. Also, if I perform a normalisearch
before performing the evil search, the warning never appears (neither for theisearch
nor the evil search, regardless whether I access search history).From what I can tell, the warning originates from make-local-variable and is being triggered in evil-search-incrementally when it let binds
isearch-search-fun-function
toevil-isearch-function
. I was able to prevent the warning by removing that line, but I suspect that's not an ideal fix.Screenshot:
The text was updated successfully, but these errors were encountered: