GNU bug report logs - #13402
24.2.92 pretest: bugs in isearch-yank-line in info page

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Thu, 10 Jan 2013 13:33:01 UTC

Severity: normal

Found in version 24.2.92

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 13402 <at> debbugs.gnu.org
Subject: bug#13402: 24.2.92 pretest: bugs in isearch-yank-line in info page. [Patch]
Date: Thu, 21 Feb 2013 02:45:31 +0200
>> The result is that the first space character is not lazy-highlighted.
>> I think this is wrong.
>
> :-).  I'm not sure.  It has a certain logic behind it.  I think a missing
> lazy-highlight is much less disturbing than an obtrusive one.

Alan, I completely agree with you.  Your logic makes perfect sense.
An obtrusive lazy-highlight is too disturbing.

But I also think that my logic makes sense as well
since a missing lazy-highlight is too bad.

Fortunately, it is possible to combine both logics
with a small patch that you can see below.

The key point is that the lazy-highlighting loop should start
from the same position where the main search function found
the beginning of the match!

Currently the boundary of the lazy-highlighting loop starts at the end
of the found match (the value of `(point)').  But the match found by
the main search function (and highlighted by the primary face `isearch')
begins at `isearch-other-end'.  So currently they are mutually inconsistent.

This patch moves the boundary of lazy-highlighting from the end
of the found match to its beginning - like in the main search function.
Thus it brings the logic of `isearch-lazy-highlight-search' closer to
the logic of the main search function in `isearch-search'.

In the result of removing this inconsistency, this patch passes
the test case that you posted in your original bug report,
i.e. placing point at the start of the second paragraph
("   Each entry in a ....") and typing `C-s M-s C-e' (isearch-yank-line)
doesn't highlight the gap preceding the paragraph with lazy-highlight face.
And it also passes other tests that I tried.

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2013-02-01 23:38:41 +0000
+++ lisp/isearch.el	2013-02-21 00:45:05 +0000
@@ -2936,8 +2936,8 @@ (defun isearch-lazy-highlight-new-loop (
     (setq isearch-lazy-highlight-window       (selected-window)
 	  isearch-lazy-highlight-window-start (window-start)
 	  isearch-lazy-highlight-window-end   (window-end)
-	  isearch-lazy-highlight-start        (point)
-	  isearch-lazy-highlight-end          (point)
+	  isearch-lazy-highlight-start        (or isearch-other-end (point))
+	  isearch-lazy-highlight-end          (or isearch-other-end (point))
 	  isearch-lazy-highlight-wrapped      nil
 	  isearch-lazy-highlight-last-string  isearch-string
 	  isearch-lazy-highlight-case-fold-search isearch-case-fold-search





This bug report was last modified 12 years and 92 days ago.

Previous Next


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