Mercurial > emacs
changeset 8866:48a0ea73a9d7
(Fkey_description): Give error if KEYS not an array.
(get_keyelt, access_keymap, get_keymap_1): Use type test macros.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 18 Sep 1994 04:02:25 +0000 |
parents | 3fe65c32616b |
children | 73a95a7efdce |
files | src/keymap.c |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/keymap.c Sat Sep 17 23:52:45 1994 +0000 +++ b/src/keymap.c Sun Sep 18 04:02:25 1994 +0000 @@ -214,7 +214,7 @@ /* Should we do an autoload? Autoload forms for keymaps have Qkeymap as their fifth element. */ if (autoload - && XTYPE (object) == Lisp_Symbol + && SYMBOLP (object) && CONSP (tem) && EQ (XCONS (tem)->car, Qautoload)) { @@ -279,7 +279,7 @@ /* If idx is a symbol, it might have modifiers, which need to be put in the canonical order. */ - if (XTYPE (idx) == Lisp_Symbol) + if (SYMBOLP (idx)) idx = reorder_modifiers (idx); else if (INTEGERP (idx)) /* Clobber the high bits that can be present on a machine @@ -318,7 +318,7 @@ break; case Lisp_Vector: - if (XTYPE (idx) == Lisp_Int + if (INTEGERP (idx) && XINT (idx) >= 0 && XINT (idx) < XVECTOR (binding)->size) { @@ -368,14 +368,14 @@ use DEFN. Keymap alist elements like (CHAR MENUSTRING . DEFN) will be used by HierarKey menus. */ - else if (XTYPE (object) == Lisp_Cons - && XTYPE (XCONS (object)->car) == Lisp_String) + else if (CONSP (object) + && STRINGP (XCONS (object)->car)) { object = XCONS (object)->cdr; /* Also remove a menu help string, if any, following the menu item name. */ if (XTYPE (object) == Lisp_Cons - && XTYPE (XCONS (object)->car) == Lisp_String) + && STRINGP (XCONS (object)->car) == Lisp_String) object = XCONS (object)->cdr; /* Also remove the sublist that caches key equivalences, if any. */ if (CONSP (object) @@ -1351,7 +1351,7 @@ Lisp_Object sep; Lisp_Object *args; - if (XTYPE (keys) == Lisp_String) + if (STRINGP (keys)) { Lisp_Object vector; vector = Fmake_vector (Flength (keys), Qnil); @@ -1366,6 +1366,8 @@ } keys = vector; } + else if (VECTORP (keys)) + keys = wrong_type_argument (Qarrayp, keys); /* In effect, this computes (mapconcat 'single-key-description keys " ")