changeset 30371:f69ecffe8453

(note_mouse_highlight): Process overlays in the right order of priority.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 21 Jul 2000 15:54:14 +0000
parents e39d4add1859
children 2047c9586451
files src/xterm.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xterm.c	Fri Jul 21 15:38:39 2000 +0000
+++ b/src/xterm.c	Fri Jul 21 15:54:14 2000 +0000
@@ -6522,7 +6522,8 @@
 	    overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
 	    noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL);
 	  }
-	  
+
+	/* Sort overlays into increasing priority order.  */
 	noverlays = sort_overlays (overlay_vec, noverlays, w);
 
 	/* Check mouse-face highlighting.  */
@@ -6540,7 +6541,7 @@
 
 	    /* Find the highest priority overlay that has a mouse-face prop.  */
 	    overlay = Qnil;
-	    for (i = 0; i < noverlays; i++)
+	    for (i = noverlays - 1; i >= 0; --i)
 	      {
 		mouse_face = Foverlay_get (overlay_vec[i], Qmouse_face);
 		if (!NILP (mouse_face))
@@ -6630,7 +6631,7 @@
 
 	  /* Check overlays first.  */
 	  help = Qnil;
-	  for (i = 0; i < noverlays && NILP (help); ++i)
+	  for (i = noverlays - 1; i >= 0 && NILP (help); --i)
 	    {
 	      overlay = overlay_vec[i];
 	      help = Foverlay_get (overlay, Qhelp_echo);