emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/isearch.el,v


From: Juri Linkov
Subject: [Emacs-diffs] Changes to emacs/lisp/isearch.el,v
Date: Tue, 11 Nov 2008 19:57:05 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Juri Linkov <jurta>     08/11/11 19:57:05

Index: isearch.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.333
retrieving revision 1.334
diff -u -b -r1.333 -r1.334
--- isearch.el  11 Nov 2008 19:48:37 -0000      1.333
+++ isearch.el  11 Nov 2008 19:57:04 -0000      1.334
@@ -2619,13 +2619,14 @@
 (defun isearch-lazy-highlight-search ()
   "Search ahead for the next or previous match, for lazy highlighting.
 Attempt to do the search exactly the way the pending isearch would."
+  (condition-case nil
   (let ((case-fold-search isearch-lazy-highlight-case-fold-search)
        (isearch-regexp isearch-lazy-highlight-regexp)
-       (search-spaces-regexp isearch-lazy-highlight-space-regexp))
-    (condition-case nil
-       (isearch-search-string
-                isearch-lazy-highlight-last-string
-                (if isearch-forward
+           (search-spaces-regexp isearch-lazy-highlight-space-regexp)
+           (search-invisible nil)      ; don't match invisible text
+           (retry t)
+           (success nil)
+           (bound (if isearch-forward
                     (min (or isearch-lazy-highlight-end-limit (point-max))
                          (if isearch-lazy-highlight-wrapped
                              isearch-lazy-highlight-start
@@ -2633,9 +2634,17 @@
                   (max (or isearch-lazy-highlight-start-limit (point-min))
                        (if isearch-lazy-highlight-wrapped
                            isearch-lazy-highlight-end
-                         (window-start))))
-                t)
-      (error nil))))
+                           (window-start))))))
+       ;; Use a loop like in `isearch-search'
+       (while retry
+         (setq success (isearch-search-string
+                        isearch-lazy-highlight-last-string bound t))
+         (if (or (not success)
+                 (funcall isearch-success-function
+                          (match-beginning 0) (match-end 0)))
+             (setq retry nil)))
+       success)
+    (error nil)))
 
 (defun isearch-lazy-highlight-update ()
   "Update highlighting of other matches for current search."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]