diff options
| author | Gerd Moellmann | 2000-10-02 19:51:03 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-10-02 19:51:03 +0000 |
| commit | 45c477b462dfaf8c5a8d48531df517337c47fdc3 (patch) | |
| tree | d16cb1a4432475028be3048f77a63a3a492ef6d7 | |
| parent | 01c86c564d3c6281347d160fe7aaf019d02618d3 (diff) | |
| download | emacs-45c477b462dfaf8c5a8d48531df517337c47fdc3.tar.gz emacs-45c477b462dfaf8c5a8d48531df517337c47fdc3.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/isearch.el | 35 |
2 files changed, 27 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a91e59c4f04..05423217958 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2000-10-02 Gerd Moellmann <gerd@gnu.org> | 1 | 2000-10-02 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * isearch.el (isearch-lazy-highlight-update): Don't put a lazy | ||
| 4 | highlighting overlay with a different face over the overlay | ||
| 5 | isearch uses to highlight the current match because that can lead | ||
| 6 | to bad face combinations. | ||
| 7 | |||
| 3 | * loadup.el (toplevel): Load faces before isearch. | 8 | * loadup.el (toplevel): Load faces before isearch. |
| 4 | 9 | ||
| 5 | * isearch.el (isearch-faces): New custom group. | 10 | * isearch.el (isearch-faces): New custom group. |
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." | |||
| 1933 | isearch-lazy-highlight-start)) | 1933 | isearch-lazy-highlight-start)) |
| 1934 | (let ((found (isearch-lazy-highlight-search))) ;do search | 1934 | (let ((found (isearch-lazy-highlight-search))) ;do search |
| 1935 | (if found | 1935 | (if found |
| 1936 | ;; found the next match | 1936 | (progn |
| 1937 | (let ((ov (make-overlay (match-beginning 0) | 1937 | ;; Don't put a second overlay with a different face |
| 1938 | (match-end 0)))) | 1938 | ;; over/under the overlay isearch uses to highlight the |
| 1939 | (overlay-put ov 'face 'isearch-lazy-highlight-face) | 1939 | ;; current match. That can lead to odd looking face |
| 1940 | (overlay-put ov 'priority 0) | 1940 | ;; combinations. |
| 1941 | (setq isearch-lazy-highlight-overlays | 1941 | (unless (memq isearch-overlay |
| 1942 | (cons ov isearch-lazy-highlight-overlays)) | 1942 | (overlays-at (match-beginning 0))) |
| 1943 | (setq isearch-lazy-highlight-timer | 1943 | ;; found the next match |
| 1944 | (run-at-time isearch-lazy-highlight-interval nil | 1944 | (let ((ov (make-overlay (match-beginning 0) |
| 1945 | 'isearch-lazy-highlight-update)) | 1945 | (match-end 0)))) |
| 1946 | (if isearch-forward | 1946 | (overlay-put ov 'face isearch-lazy-highlight-face) |
| 1947 | (setq isearch-lazy-highlight-end (point)) | 1947 | (overlay-put ov 'priority 0) |
| 1948 | (setq isearch-lazy-highlight-start (point)))) | 1948 | (setq isearch-lazy-highlight-overlays |
| 1949 | (cons ov isearch-lazy-highlight-overlays)))) | ||
| 1950 | |||
| 1951 | (setq isearch-lazy-highlight-timer | ||
| 1952 | (run-at-time isearch-lazy-highlight-interval nil | ||
| 1953 | 'isearch-lazy-highlight-update)) | ||
| 1954 | (if isearch-forward | ||
| 1955 | (setq isearch-lazy-highlight-end (point)) | ||
| 1956 | (setq isearch-lazy-highlight-start (point)))) | ||
| 1957 | |||
| 1949 | ;; found no next match | 1958 | ;; found no next match |
| 1950 | (when (not isearch-lazy-highlight-wrapped) | 1959 | (when (not isearch-lazy-highlight-wrapped) |
| 1951 | ;; let's try wrapping around the end of the buffer | 1960 | ;; let's try wrapping around the end of the buffer |