aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-09-18 04:02:25 +0000
committerRichard M. Stallman1994-09-18 04:02:25 +0000
commit47684cd9b5d68ffd40bf64bbe9cecdc07ab618ce (patch)
treee89c3cfe266fa299d3730c1099c9a0be9cbc04f0 /src/keymap.c
parentedd2556799c17c260c565f1bb43bae856a9c5b40 (diff)
downloademacs-47684cd9b5d68ffd40bf64bbe9cecdc07ab618ce.tar.gz
emacs-47684cd9b5d68ffd40bf64bbe9cecdc07ab618ce.zip
(Fkey_description): Give error if KEYS not an array.
(get_keyelt, access_keymap, get_keymap_1): Use type test macros.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 1f32f8c622d..df12f254af9 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -214,7 +214,7 @@ get_keymap_1 (object, error, autoload)
214 /* Should we do an autoload? Autoload forms for keymaps have 214 /* Should we do an autoload? Autoload forms for keymaps have
215 Qkeymap as their fifth element. */ 215 Qkeymap as their fifth element. */
216 if (autoload 216 if (autoload
217 && XTYPE (object) == Lisp_Symbol 217 && SYMBOLP (object)
218 && CONSP (tem) 218 && CONSP (tem)
219 && EQ (XCONS (tem)->car, Qautoload)) 219 && EQ (XCONS (tem)->car, Qautoload))
220 { 220 {
@@ -279,7 +279,7 @@ access_keymap (map, idx, t_ok, noinherit)
279 279
280 /* If idx is a symbol, it might have modifiers, which need to 280 /* If idx is a symbol, it might have modifiers, which need to
281 be put in the canonical order. */ 281 be put in the canonical order. */
282 if (XTYPE (idx) == Lisp_Symbol) 282 if (SYMBOLP (idx))
283 idx = reorder_modifiers (idx); 283 idx = reorder_modifiers (idx);
284 else if (INTEGERP (idx)) 284 else if (INTEGERP (idx))
285 /* Clobber the high bits that can be present on a machine 285 /* Clobber the high bits that can be present on a machine
@@ -318,7 +318,7 @@ access_keymap (map, idx, t_ok, noinherit)
318 break; 318 break;
319 319
320 case Lisp_Vector: 320 case Lisp_Vector:
321 if (XTYPE (idx) == Lisp_Int 321 if (INTEGERP (idx)
322 && XINT (idx) >= 0 322 && XINT (idx) >= 0
323 && XINT (idx) < XVECTOR (binding)->size) 323 && XINT (idx) < XVECTOR (binding)->size)
324 { 324 {
@@ -368,14 +368,14 @@ get_keyelt (object, autoload)
368 use DEFN. 368 use DEFN.
369 Keymap alist elements like (CHAR MENUSTRING . DEFN) 369 Keymap alist elements like (CHAR MENUSTRING . DEFN)
370 will be used by HierarKey menus. */ 370 will be used by HierarKey menus. */
371 else if (XTYPE (object) == Lisp_Cons 371 else if (CONSP (object)
372 && XTYPE (XCONS (object)->car) == Lisp_String) 372 && STRINGP (XCONS (object)->car))
373 { 373 {
374 object = XCONS (object)->cdr; 374 object = XCONS (object)->cdr;
375 /* Also remove a menu help string, if any, 375 /* Also remove a menu help string, if any,
376 following the menu item name. */ 376 following the menu item name. */
377 if (XTYPE (object) == Lisp_Cons 377 if (XTYPE (object) == Lisp_Cons
378 && XTYPE (XCONS (object)->car) == Lisp_String) 378 && STRINGP (XCONS (object)->car) == Lisp_String)
379 object = XCONS (object)->cdr; 379 object = XCONS (object)->cdr;
380 /* Also remove the sublist that caches key equivalences, if any. */ 380 /* Also remove the sublist that caches key equivalences, if any. */
381 if (CONSP (object) 381 if (CONSP (object)
@@ -1351,7 +1351,7 @@ spaces are put between sequence elements, etc.")
1351 Lisp_Object sep; 1351 Lisp_Object sep;
1352 Lisp_Object *args; 1352 Lisp_Object *args;
1353 1353
1354 if (XTYPE (keys) == Lisp_String) 1354 if (STRINGP (keys))
1355 { 1355 {
1356 Lisp_Object vector; 1356 Lisp_Object vector;
1357 vector = Fmake_vector (Flength (keys), Qnil); 1357 vector = Fmake_vector (Flength (keys), Qnil);
@@ -1366,6 +1366,8 @@ spaces are put between sequence elements, etc.")
1366 } 1366 }
1367 keys = vector; 1367 keys = vector;
1368 } 1368 }
1369 else if (VECTORP (keys))
1370 keys = wrong_type_argument (Qarrayp, keys);
1369 1371
1370 /* In effect, this computes 1372 /* In effect, this computes
1371 (mapconcat 'single-key-description keys " ") 1373 (mapconcat 'single-key-description keys " ")