GNU bug report logs -
#33838
27.0.50; lazy-highlight fails with a quick key sequence
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Sun, 23 Dec 2018 00:08:01 UTC
Severity: normal
Found in version 27.0.50
Done: Juri Linkov <juri <at> linkov.net>
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 33838 in the body.
You can then email your comments to 33838 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#33838
; Package
emacs
.
(Sun, 23 Dec 2018 00:08:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> linkov.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 23 Dec 2018 00:08:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Quickly typing `C-s C-s' to repeat the last search in a file with long
wrapped lines sometimes fails to lazy-highlight other matches.
This is because the condition in isearch-lazy-highlight-new-loop relies on
the return value of `(sit-for 0)' and when there is input pending like the
second `C-s' keystroke unprocessed due to the large file size with long
lines, it doesn't start a new lazy-highlight loop.
I noticed this problem only after starting to use lazy-count that fails
to count matches. Before that, there was no clear indication that
lazy-highlight failed in such cases.
I doubt that relying on its return value was intentional, so I propose
the following fix:
diff --git a/lisp/isearch.el b/lisp/isearch.el
index dd0973d4ea..5876e70305 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -3661,7 +3661,7 @@ isearch-lazy-highlight-new-loop
search string to change or the window to scroll). It is also used
by other Emacs features."
(when (and (null executing-kbd-macro)
- (sit-for 0) ;make sure (window-start) is credible
+ (progn (sit-for 0) t) ;make sure (window-start) is credible
(or (not (equal isearch-string
isearch-lazy-highlight-last-string))
(not (memq (selected-window)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#33838
; Package
emacs
.
(Sun, 23 Dec 2018 23:30:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 33838 <at> debbugs.gnu.org (full text, mbox):
> Quickly typing `C-s C-s' to repeat the last search in a file with long
> wrapped lines sometimes fails to lazy-highlight other matches.
>
> This is because the condition in isearch-lazy-highlight-new-loop relies on
> the return value of `(sit-for 0)' and when there is input pending like the
> second `C-s' keystroke unprocessed due to the large file size with long
> lines, it doesn't start a new lazy-highlight loop.
I realized that sit-for here is for a reason to not try running
isearch-lazy-highlight-new-loop on every keypress. The problem is that
when the first `C-s' is ignored (in this case isearch-string is an empty
string and isearch-lazy-highlight-last-string is the last search string),
for the second `C-s', isearch-string is equal to isearch-lazy-highlight-last-string
from the last search, so a new loop is not initiated.
A proper fix would be to reset isearch-lazy-highlight-last-string
on exiting Isearch, so it won't affect the next search:
diff --git a/lisp/isearch.el b/lisp/isearch.el
index dd0973d4ea..d2c1c150b5 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1357,6 +1357,7 @@ isearch-done
(setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout)
(isearch-dehighlight)
(lazy-highlight-cleanup lazy-highlight-cleanup)
+ (setq isearch-lazy-highlight-last-string nil)
(let ((found-start (window-group-start))
(found-point (point)))
(when isearch-window-configuration
Reply sent
to
Juri Linkov <juri <at> linkov.net>
:
You have taken responsibility.
(Tue, 25 Dec 2018 21:56:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Juri Linkov <juri <at> linkov.net>
:
bug acknowledged by developer.
(Tue, 25 Dec 2018 21:56:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 33838-done <at> debbugs.gnu.org (full text, mbox):
> A proper fix would be to reset isearch-lazy-highlight-last-string
> on exiting Isearch, so it won't affect the next search:
Pushed to master and closed.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 23 Jan 2019 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 6 years and 145 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.