changeset 89640:99303f55a1b8

(store_in_keymap): Pay attention to the case that idx is a cons specifying a character range.
author Kenichi Handa <handa@m17n.org>
date Sat, 22 Nov 2003 11:04:01 +0000
parents 6c59a027436a
children 30d05f6d5863
files src/keymap.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/keymap.c	Sat Nov 22 07:46:40 2003 +0000
+++ b/src/keymap.c	Sat Nov 22 11:04:01 2003 +0000
@@ -826,10 +826,15 @@
   if (!CONSP (keymap) || !EQ (XCAR (keymap), Qkeymap))
     error ("attempt to define a key in a non-keymap");
 
-  /* If idx is a list (some sort of mouse click, perhaps?),
-     the index we want to use is the car of the list, which
-     ought to be a symbol.  */
-  idx = EVENT_HEAD (idx);
+  /* If idx is a cons, and the car part is a character, idx must be of
+     the form (FROM-CHAR . TO-CHAR).  */
+  if (CONSP (idx) && CHARACTERP (XCAR (idx)))
+    CHECK_CHARACTER_CDR (idx);
+  else
+    /* If idx is a list (some sort of mouse click, perhaps?),
+       the index we want to use is the car of the list, which
+       ought to be a symbol.  */
+    idx = EVENT_HEAD (idx);
 
   /* If idx is a symbol, it might have modifiers, which need to
      be put in the canonical order.  */