GNU bug report logs - #33838
27.0.50; lazy-highlight fails with a quick key sequence

Previous Next

Package: emacs;

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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Juri Linkov <juri <at> linkov.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#33838: closed (27.0.50; lazy-highlight fails with a quick key
 sequence)
Date: Tue, 25 Dec 2018 21:56:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 25 Dec 2018 23:54:42 +0200
with message-id <8736qlmfvh.fsf <at> mail.linkov.net>
and subject line Re: bug#33838: 27.0.50; lazy-highlight fails with a quick key sequence
has caused the debbugs.gnu.org bug report #33838,
regarding 27.0.50; lazy-highlight fails with a quick key sequence
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
33838: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33838
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; lazy-highlight fails with a quick key sequence
Date: Sun, 23 Dec 2018 02:05:19 +0200
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)



[Message part 3 (message/rfc822, inline)]
From: Juri Linkov <juri <at> linkov.net>
To: 33838-done <at> debbugs.gnu.org
Subject: Re: bug#33838: 27.0.50; lazy-highlight fails with a quick key sequence
Date: Tue, 25 Dec 2018 23:54:42 +0200
> 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.


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.