From 349c653ee57a17fed33bf359e2ef965f58d03a4c Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 6 Jan 2004 22:38:23 +0000 Subject: [PATCH] (note_mode_line_or_margin_highlight): Use modified mode_line_string and marginal_area_string functions to handle both string object and image object properties. --- src/xdisp.c | 75 ++++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 8a6f36ef17b..20ec887bd60 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20171,53 +20171,26 @@ note_mode_line_or_margin_highlight (w, x, y, area) Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor; Lisp_Object pointer = Qnil; - int charpos, dx, dy; - Lisp_Object string; + int charpos, dx, dy, width, height; + Lisp_Object string, object = Qnil; Lisp_Object pos, help, image; if (area == ON_MODE_LINE || area == ON_HEADER_LINE) - string = mode_line_string (w, &x, &y, 0, 0, area, &charpos); + string = mode_line_string (w, area, &x, &y, &charpos, + &object, &dx, &dy, &width, &height); else { x -= WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w); - string = marginal_area_string (w, &x, &y, &dx, &dy, area, &charpos); + string = marginal_area_string (w, area, &x, &y, &charpos, + &object, &dx, &dy, &width, &height); } help = Qnil; - if (STRINGP (string)) - { - pos = make_number (charpos); - /* If we're on a string with `help-echo' text property, arrange - for the help to be displayed. This is done by setting the - global variable help_echo_string to the help string. */ - help = Fget_text_property (pos, Qhelp_echo, string); - if (!NILP (help)) - { - help_echo_string = help; - XSETWINDOW (help_echo_window, w); - help_echo_object = string; - help_echo_pos = charpos; - } - - if (NILP (pointer)) - pointer = Fget_text_property (pos, Qpointer, string); - - /* Change the mouse pointer according to what is under X/Y. */ - if (NILP (pointer) && area == ON_MODE_LINE) - { - Lisp_Object map; - map = Fget_text_property (pos, Qlocal_map, string); - if (!KEYMAPP (map)) - map = Fget_text_property (pos, Qkeymap, string); - if (!KEYMAPP (map)) - cursor = dpyinfo->vertical_scroll_bar_cursor; - } - } - else if (IMAGEP (string)) + if (IMAGEP (object)) { Lisp_Object image_map, hotspot; - if ((image_map = Fplist_get (XCDR (string), QCmap), + if ((image_map = Fplist_get (XCDR (object), QCmap), !NILP (image_map)) && (hotspot = find_hot_spot (image_map, dx, dy), CONSP (hotspot)) @@ -20245,7 +20218,37 @@ note_mode_line_or_margin_highlight (w, x, y, area) } } if (NILP (pointer)) - pointer = Fplist_get (XCDR (string), QCpointer); + pointer = Fplist_get (XCDR (object), QCpointer); + } + } + + if (STRINGP (string)) + { + pos = make_number (charpos); + /* If we're on a string with `help-echo' text property, arrange + for the help to be displayed. This is done by setting the + global variable help_echo_string to the help string. */ + help = Fget_text_property (pos, Qhelp_echo, string); + if (!NILP (help)) + { + help_echo_string = help; + XSETWINDOW (help_echo_window, w); + help_echo_object = string; + help_echo_pos = charpos; + } + + if (NILP (pointer)) + pointer = Fget_text_property (pos, Qpointer, string); + + /* Change the mouse pointer according to what is under X/Y. */ + if (NILP (pointer) && area == ON_MODE_LINE) + { + Lisp_Object map; + map = Fget_text_property (pos, Qlocal_map, string); + if (!KEYMAPP (map)) + map = Fget_text_property (pos, Qkeymap, string); + if (!KEYMAPP (map)) + cursor = dpyinfo->vertical_scroll_bar_cursor; } } -- 2.39.2