From 939f0e96e7826e518a1b304b7b6a365bd82cdda3 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sat, 22 Nov 2003 11:04:01 +0000 Subject: [PATCH] (store_in_keymap): Pay attention to the case that idx is a cons specifying a character range. --- src/keymap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index dd5bea45f59..e3d866f4756 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -826,10 +826,15 @@ store_in_keymap (keymap, idx, def) 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. */ -- 2.39.2