2001-03-09 Gerd Moellmann <gerd@gnu.org>
+ * dispextern.h (string_buffer_position): Add prototype.
+
+ * xdisp.c (string_buffer_position, display_prop_string_p)
+ (single_display_prop_string_p): New functions.
+
+ * xterm.c (note_mouse_highlight): If there's no help-echo on
+ a string, look at the buffer text ``under'' it.
+
+ * keyboard.c (make_lispy_event): Add string info to the event,
+ analogous to what's done on mode lines.
+ (read_key_sequence): For a click on a string, consider `local-map'
+ and `keymap' of that string.
+
* keyboard.c (make_lispy_event, make_lispy_movement): Adjust
calls to buffer_posn_from_coords to new format.
struct display_pos p;
buffer_posn_from_coords (w, &wx, &wy, &object, &p);
posn = make_number (CHARPOS (p.pos));
+ if (STRINGP (object))
+ string_info
+ = Fcons (object,
+ make_number (CHARPOS (p.string_pos)));
}
}
int can_return_switch_frame;
int fix_current_buffer;
{
+ volatile Lisp_Object from_string;
volatile int count = specpdl_ptr - specpdl;
/* How many keys there are in the current key sequence. */
orig_local_map = get_local_map (PT, current_buffer, Qlocal_map);
orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
+ from_string = Qnil;
/* We jump here when the key sequence has been thoroughly changed, and
we need to rescan it starting from the beginning. When we jump here,
goto replay_key;
}
+ else if (CONSP (POSN_STRING (EVENT_START (key)))
+ && NILP (from_string))
+ {
+ /* For a click on a string, i.e. overlay string or a
+ string displayed via the `display' property,
+ consider `local-map' and `keymap' properties of
+ that string. */
+ Lisp_Object string, pos, map, map2;
+
+ string = POSN_STRING (EVENT_START (key));
+ pos = XCDR (string);
+ string = XCAR (string);
+ if (XINT (pos) >= 0
+ && XINT (pos) < XSTRING (string)->size)
+ {
+ map = Fget_text_property (pos, Qlocal_map, string);
+ if (!NILP (map))
+ orig_local_map = map;
+ map2 = Fget_text_property (pos, Qkeymap, string);
+ if (!NILP (map2))
+ orig_keymap = map2;
+
+ if (!NILP (map) || !NILP (map2))
+ {
+ from_string = string;
+ goto replay_sequence;
+ }
+ }
+ }
}
else if (CONSP (XCDR (key))
&& CONSP (EVENT_START (key))