aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2000-07-23 13:03:16 +0000
committerEli Zaretskii2000-07-23 13:03:16 +0000
commitf0a4139c7685a1fc4d6390ce9f797d62ebafa5c6 (patch)
tree5f82834b90a48c8327c542b6421fe3ff5f1786b4 /src
parentb2d305a89db9fa21feae76bccbde05a05f2c4e91 (diff)
downloademacs-f0a4139c7685a1fc4d6390ce9f797d62ebafa5c6.tar.gz
emacs-f0a4139c7685a1fc4d6390ce9f797d62ebafa5c6.zip
(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.
Diffstat (limited to 'src')
-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)
1537 noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL); 1537 noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL);
1538 } 1538 }
1539 1539
1540 /* Sort overlays into increasing priority order. */
1540 noverlays = sort_overlays (overlay_vec, noverlays, w); 1541 noverlays = sort_overlays (overlay_vec, noverlays, w);
1541 1542
1542 /* Check mouse-face highlighting. */ 1543 /* Check mouse-face highlighting. */
@@ -1554,7 +1555,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
1554 1555
1555 /* Find highest priority overlay that has a mouse-face prop. */ 1556 /* Find highest priority overlay that has a mouse-face prop. */
1556 overlay = Qnil; 1557 overlay = Qnil;
1557 for (i = 0; i < noverlays; i++) 1558 for (i = noverlays - 1; i >= 0; --i)
1558 { 1559 {
1559 mouse_face = Foverlay_get (overlay_vec[i], Qmouse_face); 1560 mouse_face = Foverlay_get (overlay_vec[i], Qmouse_face);
1560 if (!NILP (mouse_face)) 1561 if (!NILP (mouse_face))
@@ -1638,14 +1639,17 @@ IT_note_mouse_highlight (struct frame *f, int x, int y)
1638 1639
1639 /* Check overlays first. */ 1640 /* Check overlays first. */
1640 help = Qnil; 1641 help = Qnil;
1641 for (i = 0; i < noverlays && NILP (help); ++i) 1642 for (i = noverlays - 1; i >= 0 && NILP (help); --i)
1642 help = Foverlay_get (overlay_vec[i], Qhelp_echo); 1643 {
1644 overlay = overlay_vec[i];
1645 help = Foverlay_get (overlay, Qhelp_echo);
1646 }
1643 1647
1644 if (!NILP (help)) 1648 if (!NILP (help))
1645 { 1649 {
1646 help_echo = help; 1650 help_echo = help;
1647 help_echo_window = window; 1651 help_echo_window = window;
1648 help_echo_object = w->buffer; 1652 help_echo_object = overlay;
1649 help_echo_pos = pos; 1653 help_echo_pos = pos;
1650 } 1654 }
1651 /* Try text properties. */ 1655 /* Try text properties. */