summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2000-07-23 13:03:16 +0000
committerEli Zaretskii <eliz@gnu.org>2000-07-23 13:03:16 +0000
commitf0a4139c7685a1fc4d6390ce9f797d62ebafa5c6 (patch)
tree5f82834b90a48c8327c542b6421fe3ff5f1786b4
parentb2d305a89db9fa21feae76bccbde05a05f2c4e91 (diff)
downloademacs-f0a4139c7685a1fc4d6390ce9f797d62ebafa5c6.tar.gz
(IT_note_mouse_highlight): Process overlays in the
correct order of priority. If help echo was found in an overlay, use that overlay as the object in which the help echo was found.
-rw-r--r--src/msdos.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 3e6dbf236de..8ec5a21faf7 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1537,6 +1537,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
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. */
@@ -1554,7 +1555,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
/* Find 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))
@@ -1638,14 +1639,17 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
/* Check overlays first. */
help = Qnil;
- for (i = 0; i < noverlays && NILP (help); ++i)
- help = Foverlay_get (overlay_vec[i], Qhelp_echo);
+ for (i = noverlays - 1; i >= 0 && NILP (help); --i)
+ {
+ overlay = overlay_vec[i];
+ help = Foverlay_get (overlay, Qhelp_echo);
+ }
if (!NILP (help))
{
help_echo = help;
help_echo_window = window;
- help_echo_object = w->buffer;
+ help_echo_object = overlay;
help_echo_pos = pos;
}
/* Try text properties. */