From b067ddb637ea73f557012ab9e74e13d3e0ba0c7a Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 11 Sep 2006 02:34:05 +0000 Subject: [PATCH] * keymap.c (Fkey_binding): Check for local keymap for mouse click events. --- src/ChangeLog | 5 +++++ src/keymap.c | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 2bc50904caa..a2fa51db1b2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-09-10 Chong Yidong + + * keymap.c (Fkey_binding): Check for local keymap for mouse click + events. + 2006-09-10 Kim F. Storm * keyboard.c (Finput_pending_p): Check Vunread_input_method_events diff --git a/src/keymap.c b/src/keymap.c index 4871179c420..1d854f77b4c 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1576,6 +1576,33 @@ is non-nil, `key-binding' returns the unmapped command. */) GCPRO1 (key); +#ifdef HAVE_MOUSE + if (VECTORP (key) + && ASIZE (key) > 0 + && CONSP (AREF (key, 0)) + && SYMBOLP (XCAR (AREF (key, 0))) + && CONSP (XCDR (AREF (key, 0)))) + { + Lisp_Object map, obj, pos = XCAR (XCDR (AREF (key, 0))); + + if (XINT (Flength (pos)) == 10 && INTEGERP (XCAR (XCDR (pos)))) + { + obj = Fnth (make_number(4), pos); + map = Fget_char_property (XCAR (XCDR (pos)), + Qkeymap, + NILP (obj) ? + Fwindow_buffer (XCAR (pos)) + : XCAR (obj)); + if (!NILP (Fkeymapp (map))) + { + value = Flookup_key (map, key, accept_default); + if (! NILP (value) && !INTEGERP (value)) + goto done; + } + } + } +#endif /* HAVE_MOUSE */ + if (!NILP (current_kboard->Voverriding_terminal_local_map)) { value = Flookup_key (current_kboard->Voverriding_terminal_local_map, -- 2.39.2