diff options
author | Gerd Moellmann <gerd@gnu.org> | 2000-10-02 19:50:18 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2000-10-02 19:50:18 +0000 |
commit | 4c66a5037f4a4ef01432aa8d8e0250257f4c6b96 (patch) | |
tree | 8ef913dd944ff1564700bb80eeffc67fa92b5c9d /lisp/isearch.el | |
parent | 3e8f310e08f15e3539eccfa96bcdce74cd98bd06 (diff) | |
download | emacs-4c66a5037f4a4ef01432aa8d8e0250257f4c6b96.tar.gz |
(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.
Diffstat (limited to 'lisp/isearch.el')
-rw-r--r-- | lisp/isearch.el | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index 41b94cf9989..8367a3b809a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -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 |