diff src/keymap.c @ 73350:1a3368a80879

* keymap.c (Fkey_binding): Check Lisp_Object types before doing XCAR and XINT.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 13 Oct 2006 01:45:37 +0000
parents 645da5a91b56
children 3c809b430d91 2d56e13fd23d 8dd8c8286063
line wrap: on
line diff
--- a/src/keymap.c	Fri Oct 13 01:41:11 2006 +0000
+++ b/src/keymap.c	Fri Oct 13 01:45:37 2006 +0000
@@ -1610,13 +1610,12 @@
 
       /* We are not interested in locations without event data */
 
-      if (EVENT_HAS_PARAMETERS (event)) {
-	Lisp_Object kind;
-
-	kind = EVENT_HEAD_KIND (EVENT_HEAD (event));
-	if (EQ (kind, Qmouse_click))
-	  position = EVENT_START (event);
-      }
+      if (EVENT_HAS_PARAMETERS (event))
+	{
+	  Lisp_Object kind = EVENT_HEAD_KIND (EVENT_HEAD (event));
+	  if (CONSP (XCDR (event)) && EQ (kind, Qmouse_click))
+	    position = EVENT_START (event);
+	}
     }
 
   /* Key sequences beginning with mouse clicks
@@ -1709,7 +1708,8 @@
 	      
 	      pos = XCDR (string);
 	      string = XCAR (string);
-	      if (XINT (pos) >= 0
+	      if (INTEGERP (pos)
+		  && XINT (pos) >= 0
 		  && XINT (pos) < SCHARS (string))
 		{
 		  map = Fget_text_property (pos, Qlocal_map, string);