]> git.eshelyaron.com Git - emacs.git/commitdiff
(isearch-lazy-highlight-update): Don't put a lazy
authorGerd Moellmann <gerd@gnu.org>
Mon, 2 Oct 2000 19:51:03 +0000 (19:51 +0000)
committerGerd Moellmann <gerd@gnu.org>
Mon, 2 Oct 2000 19:51:03 +0000 (19:51 +0000)
highlighting overlay with a different face over the overlay
isearch uses to highlight the current match because that can lead
to bad face combinations.

lisp/ChangeLog
lisp/isearch.el

index a91e59c4f04c4a3281bb66448bcda744ef572c25..054232179584262f947237ab245a0527d9387a4f 100644 (file)
@@ -1,5 +1,10 @@
 2000-10-02  Gerd Moellmann  <gerd@gnu.org>
 
+       * isearch.el (isearch-lazy-highlight-update): Don't put a lazy
+       highlighting overlay with a different face over the overlay
+       isearch uses to highlight the current match because that can lead
+       to bad face combinations.
+
        * loadup.el (toplevel): Load faces before isearch.
 
        * isearch.el (isearch-faces): New custom group.
index 41b94cf9989eab4940a3c542f6ab1c4ac243c704..8367a3b809a06bf9944a76f522a7843a68362482 100644 (file)
@@ -1933,19 +1933,28 @@ Attempt to do the search exactly the way the pending isearch would."
                      isearch-lazy-highlight-start))
         (let ((found (isearch-lazy-highlight-search))) ;do search
           (if found
-              ;; found the next match
-              (let ((ov (make-overlay (match-beginning 0)
-                                      (match-end 0))))
-                (overlay-put ov 'face 'isearch-lazy-highlight-face)
-                (overlay-put ov 'priority 0)
-                (setq isearch-lazy-highlight-overlays
-                      (cons ov isearch-lazy-highlight-overlays))
-                (setq isearch-lazy-highlight-timer
-                      (run-at-time isearch-lazy-highlight-interval nil
-                                   'isearch-lazy-highlight-update))
-                (if isearch-forward
-                    (setq isearch-lazy-highlight-end (point))
-                  (setq isearch-lazy-highlight-start (point))))
+             (progn
+               ;; Don't put a second overlay with a different face
+               ;; over/under the overlay isearch uses to highlight the
+               ;; current match.  That can lead to odd looking face
+               ;; combinations.
+               (unless (memq isearch-overlay
+                             (overlays-at (match-beginning 0)))
+                 ;; found the next match
+                 (let ((ov (make-overlay (match-beginning 0)
+                                         (match-end 0))))
+                   (overlay-put ov 'face isearch-lazy-highlight-face)
+                   (overlay-put ov 'priority 0)
+                   (setq isearch-lazy-highlight-overlays
+                         (cons ov isearch-lazy-highlight-overlays))))
+                 
+               (setq isearch-lazy-highlight-timer
+                     (run-at-time isearch-lazy-highlight-interval nil
+                                  'isearch-lazy-highlight-update))
+               (if isearch-forward
+                   (setq isearch-lazy-highlight-end (point))
+                 (setq isearch-lazy-highlight-start (point))))
+
             ;; found no next match
             (when (not isearch-lazy-highlight-wrapped)
               ;; let's try wrapping around the end of the buffer