GNU bug report logs - #19353
25.0.50; Lazy Highlighting

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Thu, 11 Dec 2014 21:13:02 UTC

Severity: minor

Found in version 25.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 19353 in the body.
You can then email your comments to 19353 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#19353; Package emacs. (Thu, 11 Dec 2014 21:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dani Moncayo <dmoncayo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 Dec 2014 21:13:02 GMT) Full text and rfc822 format available.

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

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: bug-gnu-emacs <bug-gnu-emacs <at> gnu.org>
Subject: 25.0.50; Lazy Highlighting
Date: Thu, 11 Dec 2014 22:12:12 +0100
Recipe:
0. emacs -Q
1. Create and empty buffer.
2. Write there this text (without the hyphen lines):
--------------
fat cat path
too book cool
--------------
3. Place point just after the "a" in "path".
4. Type: C-s a t

Here, the "at" in "path" is not highlighted at all.  Wrong: it should
be lazy-highlighted because it's one match of the current search
string, that can be reached by repeating "C-s".  This bug becomes more
obvious if you type "C-s" several times at this moment.

5. Place point just after the first "o" in "cool".
6. Type: C-s o o

This second scenario is similar: the "oo" in "cool" should be
lazy-highlighted, because it's a match.  Well, in this case the second
"o" in "cool" cannot be (and is not) lazy-highlighted because it's the
current (partial) match, and the Isearch face must take precedence
over the lazy-highlighting.  But still, the first "o" in "cool" should
be lazy-highlighted.

Now type another "C-s", and you will see:
* The "oo" in "too" highlighted as the current match (correct).
* The "oo" in "book" lazy-highlighted (correct).
* The "oo" in "cool" not highlighted (wrong: should be
  lazy-highlighted).



In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2014-11-30 on LEG570
Repository revision: 3517da701ea5d16c296745d6678988b06bee615d
Windowing system distributor `Microsoft Corp.', version 6.3.9600
Configured using:
 `configure --without-dbus --enable-checking=yes,glyphs
 CPPFLAGS=-DGLYPH_DEBUG=1'


-- 
Dani Moncayo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19353; Package emacs. (Fri, 12 Dec 2014 00:29:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 19353 <at> debbugs.gnu.org
Subject: Re: bug#19353: 25.0.50; Lazy Highlighting
Date: Fri, 12 Dec 2014 02:18:10 +0200
> Recipe:
> 0. emacs -Q
> 1. Create and empty buffer.
> 2. Write there this text (without the hyphen lines):
> --------------
> fat cat path
> too book cool
> --------------
> 3. Place point just after the "a" in "path".
> 4. Type: C-s a t

> 5. Place point just after the first "o" in "cool".
> 6. Type: C-s o o

Does this patch address all your test cases?  It prolongs the
boundary of the wrapped search by the length of the search string,
and in the worst case it might lazy-highlight some matches twice.

diff --git a/lisp/isearch.el b/lisp/isearch.el
index c3e473a..5fb687b 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -3063,11 +3063,13 @@ (defun isearch-lazy-highlight-search ()
 	    (bound (if isearch-lazy-highlight-forward
 		       (min (or isearch-lazy-highlight-end-limit (point-max))
 			    (if isearch-lazy-highlight-wrapped
-				isearch-lazy-highlight-start
+				(+ isearch-lazy-highlight-start
+				   (1- (length isearch-lazy-highlight-last-string)))
 			      (window-end)))
 		     (max (or isearch-lazy-highlight-start-limit (point-min))
 			  (if isearch-lazy-highlight-wrapped
-			      isearch-lazy-highlight-end
+			      (- isearch-lazy-highlight-end
+				 (1- (length isearch-lazy-highlight-last-string)))
 			    (window-start))))))
 	;; Use a loop like in `isearch-search'.
 	(while retry




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19353; Package emacs. (Fri, 12 Dec 2014 07:56:02 GMT) Full text and rfc822 format available.

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

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 19353 <at> debbugs.gnu.org
Subject: Re: bug#19353: 25.0.50; Lazy Highlighting
Date: Fri, 12 Dec 2014 08:55:10 +0100
> Does this patch address all your test cases?

Yes Juri, it does.

Thank you.

-- 
Dani Moncayo




Reply sent to Juri Linkov <juri <at> linkov.net>:
You have taken responsibility. (Mon, 15 Dec 2014 23:46:02 GMT) Full text and rfc822 format available.

Notification sent to Dani Moncayo <dmoncayo <at> gmail.com>:
bug acknowledged by developer. (Mon, 15 Dec 2014 23:46:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 19353-done <at> debbugs.gnu.org
Subject: Re: bug#19353: 25.0.50; Lazy Highlighting
Date: Tue, 16 Dec 2014 01:45:28 +0200
Now the patch is committed, thank you for the suggestion.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 13 Jan 2015 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 161 days ago.

Previous Next


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