unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Dani Moncayo <dmoncayo@gmail.com>
Cc: 7468@debbugs.gnu.org
Subject: bug#7468: 24.0.50; Isearch highlighting
Date: Tue, 23 Nov 2010 01:34:29 +0000	[thread overview]
Message-ID: <87pqtw4yc0.fsf@mail.jurta.org> (raw)
In-Reply-To: <AANLkTinGwRTbSL39Y1Bzz=_9T=CxnuVWiGLijK0x0Y7W@mail.gmail.com> (Dani Moncayo's message of "Mon, 22 Nov 2010 21:57:52 +0100")

> I've also tried to copy that section of the manual into a brand new
> buffer, but there I can't reproduce the problem.

The difference between this recipe in a normal buffer and an Info buffer
is in the line

    (when (not isearch-error)

in `isearch-lazy-highlight-new-loop'.  A normal Isearch starts
a new lazy highlighting loop even if there are no matches,
so it has a chance to set `isearch-lazy-highlight-last-string'.
But an Isearch in Info has the text "Initial node" in `isearch-error',
so `isearch-lazy-highlight-new-loop' doesn't set the last search string
to `isearch-lazy-highlight-last-string'.

This bug is not specific to an Isearch in Info.  You can get the same bug
for a regexp Isearch in a normal buffer as:

1) Search for the regexp "foot[" (C-M-s foot[)
2) Remove the last "[" (<DEL>)

There is no lazy highlighting too.

I think this patch is a general fix for all these bug cases:

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2010-10-02 22:37:21 +0000
+++ lisp/isearch.el	2010-11-23 01:30:44 +0000
@@ -2628,6 +2628,7 @@ (defvar isearch-lazy-highlight-case-fold
 (defvar isearch-lazy-highlight-regexp nil)
 (defvar isearch-lazy-highlight-space-regexp nil)
 (defvar isearch-lazy-highlight-forward nil)
+(defvar isearch-lazy-highlight-error nil)
 
 (defun lazy-highlight-cleanup (&optional force)
   "Stop lazy highlighting and remove extra highlighting from current buffer.
@@ -2669,9 +2670,12 @@ (defun isearch-lazy-highlight-new-loop (
                  (not (= (window-end)   ; Window may have been split/joined.
 			 isearch-lazy-highlight-window-end))
 		 (not (eq isearch-forward
-			  isearch-lazy-highlight-forward))))
+			  isearch-lazy-highlight-forward))
+		 (not (eq isearch-error
+			  isearch-lazy-highlight-error))))
     ;; something important did indeed change
     (lazy-highlight-cleanup t) ;kill old loop & remove overlays
+    (setq isearch-lazy-highlight-error isearch-error)
     (when (not isearch-error)
       (setq isearch-lazy-highlight-start-limit beg
 	    isearch-lazy-highlight-end-limit end)





  reply	other threads:[~2010-11-23  1:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22 20:57 bug#7468: 24.0.50; Isearch highlighting Dani Moncayo
2010-11-23  1:34 ` Juri Linkov [this message]
2010-12-04 21:22   ` Chong Yidong
2010-12-05 22:59     ` Juri Linkov
2010-12-08 12:14       ` Dani Moncayo
2010-12-08 16:41         ` Chong Yidong
2010-12-09  1:23           ` Juri Linkov
2010-12-20  1:19     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pqtw4yc0.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=7468@debbugs.gnu.org \
    --cc=dmoncayo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).