changeset 72795:64e86769392f

* keymap.c (Fkey_binding): Check for local keymap for mouse click events.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 11 Sep 2006 02:34:05 +0000
parents 155fb0a17074
children f4ed3e6eff41
files src/ChangeLog src/keymap.c
diffstat 2 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Sep 11 02:25:00 2006 +0000
+++ b/src/ChangeLog	Mon Sep 11 02:34:05 2006 +0000
@@ -1,3 +1,8 @@
+2006-09-10  Chong Yidong  <cyd@stupidchicken.com>
+
+	* keymap.c (Fkey_binding): Check for local keymap for mouse click
+	events.
+
 2006-09-10  Kim F. Storm  <storm@cua.dk>
 
 	* keyboard.c (Finput_pending_p): Check Vunread_input_method_events
--- a/src/keymap.c	Mon Sep 11 02:25:00 2006 +0000
+++ b/src/keymap.c	Mon Sep 11 02:34:05 2006 +0000
@@ -1576,6 +1576,33 @@
 
   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,