# HG changeset patch # User Gerd Moellmann # Date 970516218 0 # Node ID b716f8518dd705ebeb3e39c5e21fa7ba4651dc76 # Parent 5821ab438337491c39f4b4d126eb93481e23afb3 (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. diff -r 5821ab438337 -r b716f8518dd7 lisp/isearch.el --- a/lisp/isearch.el Mon Oct 02 19:21:46 2000 +0000 +++ b/lisp/isearch.el Mon Oct 02 19:50:18 2000 +0000 @@ -1933,19 +1933,28 @@ 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