changeset 67425:98dba3ad8a8a

(isearch-highlight): Change main overlay priority from 1 to 1001. Simplify. (isearch-lazy-highlight-update): Change lazy overlay priority from 0 to 1000.
author Juri Linkov <juri@jurta.org>
date Fri, 09 Dec 2005 09:45:06 +0000
parents 02c3cfe8d00b
children eac49762e6b9
files lisp/isearch.el
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/isearch.el	Fri Dec 09 09:44:35 2005 +0000
+++ b/lisp/isearch.el	Fri Dec 09 09:45:06 2005 +0000
@@ -2235,17 +2235,15 @@
 (defvar isearch-overlay nil)
 
 (defun isearch-highlight (beg end)
-  (unless (null search-highlight)
-    (cond (isearch-overlay
-	   ;; Overlay already exists, just move it.
-	   (move-overlay isearch-overlay beg end (current-buffer)))
-
-	  (t
-	   ;; Overlay doesn't exist, create it.
-	   (setq isearch-overlay (make-overlay beg end))
-	   (overlay-put isearch-overlay 'face isearch)
-           (overlay-put isearch-overlay 'priority 1) ;higher than lazy overlays
-           ))))
+  (if search-highlight
+      (if isearch-overlay
+	  ;; Overlay already exists, just move it.
+	  (move-overlay isearch-overlay beg end (current-buffer))
+	;; Overlay doesn't exist, create it.
+	(setq isearch-overlay (make-overlay beg end))
+	;; 1001 is higher than lazy's 1000 and ediff's 100+
+	(overlay-put isearch-overlay 'priority 1001)
+	(overlay-put isearch-overlay 'face isearch))))
 
 (defun isearch-dehighlight ()
   (when isearch-overlay
@@ -2409,8 +2407,10 @@
 			;; non-zero-length match
 			(let ((ov (make-overlay mb me)))
 			  (push ov isearch-lazy-highlight-overlays)
+			  ;; 1000 is higher than ediff's 100+,
+			  ;; but lower than isearch main overlay's 1001
+			  (overlay-put ov 'priority 1000)
 			  (overlay-put ov 'face lazy-highlight-face)
-			  (overlay-put ov 'priority 0) ;lower than main overlay
 			  (overlay-put ov 'window (selected-window))))
 		      (if isearch-forward
 			  (setq isearch-lazy-highlight-end (point))