aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-01-06 22:38:23 +0000
committerKim F. Storm2004-01-06 22:38:23 +0000
commit349c653ee57a17fed33bf359e2ef965f58d03a4c (patch)
treefd87a4d48ea1017543a4516c2cfe95e69553d258 /src
parent03c975a4cb9f85c68dbf2fcc313fbca398828d1f (diff)
downloademacs-349c653ee57a17fed33bf359e2ef965f58d03a4c.tar.gz
emacs-349c653ee57a17fed33bf359e2ef965f58d03a4c.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c75
1 files 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)
20171 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 20171 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
20172 Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor; 20172 Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
20173 Lisp_Object pointer = Qnil; 20173 Lisp_Object pointer = Qnil;
20174 int charpos, dx, dy; 20174 int charpos, dx, dy, width, height;
20175 Lisp_Object string; 20175 Lisp_Object string, object = Qnil;
20176 Lisp_Object pos, help, image; 20176 Lisp_Object pos, help, image;
20177 20177
20178 if (area == ON_MODE_LINE || area == ON_HEADER_LINE) 20178 if (area == ON_MODE_LINE || area == ON_HEADER_LINE)
20179 string = mode_line_string (w, &x, &y, 0, 0, area, &charpos); 20179 string = mode_line_string (w, area, &x, &y, &charpos,
20180 &object, &dx, &dy, &width, &height);
20180 else 20181 else
20181 { 20182 {
20182 x -= WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w); 20183 x -= WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w);
20183 string = marginal_area_string (w, &x, &y, &dx, &dy, area, &charpos); 20184 string = marginal_area_string (w, area, &x, &y, &charpos,
20185 &object, &dx, &dy, &width, &height);
20184 } 20186 }
20185 20187
20186 help = Qnil; 20188 help = Qnil;
20187 20189
20188 if (STRINGP (string)) 20190 if (IMAGEP (object))
20189 {
20190 pos = make_number (charpos);
20191 /* If we're on a string with `help-echo' text property, arrange
20192 for the help to be displayed. This is done by setting the
20193 global variable help_echo_string to the help string. */
20194 help = Fget_text_property (pos, Qhelp_echo, string);
20195 if (!NILP (help))
20196 {
20197 help_echo_string = help;
20198 XSETWINDOW (help_echo_window, w);
20199 help_echo_object = string;
20200 help_echo_pos = charpos;
20201 }
20202
20203 if (NILP (pointer))
20204 pointer = Fget_text_property (pos, Qpointer, string);
20205
20206 /* Change the mouse pointer according to what is under X/Y. */
20207 if (NILP (pointer) && area == ON_MODE_LINE)
20208 {
20209 Lisp_Object map;
20210 map = Fget_text_property (pos, Qlocal_map, string);
20211 if (!KEYMAPP (map))
20212 map = Fget_text_property (pos, Qkeymap, string);
20213 if (!KEYMAPP (map))
20214 cursor = dpyinfo->vertical_scroll_bar_cursor;
20215 }
20216 }
20217 else if (IMAGEP (string))
20218 { 20191 {
20219 Lisp_Object image_map, hotspot; 20192 Lisp_Object image_map, hotspot;
20220 if ((image_map = Fplist_get (XCDR (string), QCmap), 20193 if ((image_map = Fplist_get (XCDR (object), QCmap),
20221 !NILP (image_map)) 20194 !NILP (image_map))
20222 && (hotspot = find_hot_spot (image_map, dx, dy), 20195 && (hotspot = find_hot_spot (image_map, dx, dy),
20223 CONSP (hotspot)) 20196 CONSP (hotspot))
@@ -20245,7 +20218,37 @@ note_mode_line_or_margin_highlight (w, x, y, area)
20245 } 20218 }
20246 } 20219 }
20247 if (NILP (pointer)) 20220 if (NILP (pointer))
20248 pointer = Fplist_get (XCDR (string), QCpointer); 20221 pointer = Fplist_get (XCDR (object), QCpointer);
20222 }
20223 }
20224
20225 if (STRINGP (string))
20226 {
20227 pos = make_number (charpos);
20228 /* If we're on a string with `help-echo' text property, arrange
20229 for the help to be displayed. This is done by setting the
20230 global variable help_echo_string to the help string. */
20231 help = Fget_text_property (pos, Qhelp_echo, string);
20232 if (!NILP (help))
20233 {
20234 help_echo_string = help;
20235 XSETWINDOW (help_echo_window, w);
20236 help_echo_object = string;
20237 help_echo_pos = charpos;
20238 }
20239
20240 if (NILP (pointer))
20241 pointer = Fget_text_property (pos, Qpointer, string);
20242
20243 /* Change the mouse pointer according to what is under X/Y. */
20244 if (NILP (pointer) && area == ON_MODE_LINE)
20245 {
20246 Lisp_Object map;
20247 map = Fget_text_property (pos, Qlocal_map, string);
20248 if (!KEYMAPP (map))
20249 map = Fget_text_property (pos, Qkeymap, string);
20250 if (!KEYMAPP (map))
20251 cursor = dpyinfo->vertical_scroll_bar_cursor;
20249 } 20252 }
20250 } 20253 }
20251 20254