changeset 112059:3252d895c242

* lisp/isearch.el (isearch-lazy-highlight-error): New variable. (isearch-lazy-highlight-new-loop): Compare `isearch-error' and `isearch-lazy-highlight-error'. Set `isearch-lazy-highlight-error' to the current value of `isearch-error' (Bug#7468).
author Juri Linkov <juri@jurta.org>
date Mon, 20 Dec 2010 01:18:15 +0000
parents 053702b1e98a
children d75c0dfd5c92
files lisp/ChangeLog lisp/isearch.el
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Dec 18 13:28:51 2010 -0800
+++ b/lisp/ChangeLog	Mon Dec 20 01:18:15 2010 +0000
@@ -1,3 +1,10 @@
+2010-12-20  Juri Linkov  <juri@jurta.org>
+
+	* isearch.el (isearch-lazy-highlight-error): New variable.
+	(isearch-lazy-highlight-new-loop): Compare `isearch-error' and
+	`isearch-lazy-highlight-error'.  Set `isearch-lazy-highlight-error'
+	to the current value of `isearch-error' (Bug#7468).
+
 2010-12-17  Chong Yidong  <cyd@stupidchicken.com>
 
 	* help-fns.el (describe-variable): Don't emit trailing whitespace
--- a/lisp/isearch.el	Sat Dec 18 13:28:51 2010 -0800
+++ b/lisp/isearch.el	Mon Dec 20 01:18:15 2010 +0000
@@ -2579,6 +2579,7 @@
 (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.
@@ -2620,9 +2621,13 @@
                  (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))
+		 ;; In case we are recovering from an error.
+		 (not (equal 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)