From f83490015c7a46bd71735bc9b81782283c958724 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Fri, 21 Jul 2000 15:54:14 +0000 Subject: [PATCH] (note_mouse_highlight): Process overlays in the right order of priority. --- src/xterm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 309ed552b1e..aec7d3b7338 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6522,7 +6522,8 @@ note_mouse_highlight (f, x, y) 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 @@ note_mouse_highlight (f, x, y) /* 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 @@ note_mouse_highlight (f, x, y) /* 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); -- 2.39.2