Mercurial > emacs
changeset 23953:c8cdb4e487cb
(Fsingle_key_description): Handle (control ?x) etc.
(Fkey_description): Handle lists like vectors.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 29 Dec 1998 22:53:25 +0000 |
parents | 4ef8ec98dd43 |
children | 7a8677cdf2bd |
files | src/keymap.c |
diffstat | 1 files changed, 40 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/keymap.c Tue Dec 29 11:42:26 1998 +0000 +++ b/src/keymap.c Tue Dec 29 22:53:25 1998 +0000 @@ -1720,24 +1720,45 @@ } keys = vector; } - else if (!VECTORP (keys)) + + if (VECTORP (keys)) + { + /* In effect, this computes + (mapconcat 'single-key-description keys " ") + but we shouldn't use mapconcat because it can do GC. */ + + len = XVECTOR (keys)->size; + sep = build_string (" "); + /* This has one extra element at the end that we don't pass to Fconcat. */ + args = (Lisp_Object *) alloca (len * 2 * sizeof (Lisp_Object)); + + for (i = 0; i < len; i++) + { + args[i * 2] = Fsingle_key_description (XVECTOR (keys)->contents[i]); + args[i * 2 + 1] = sep; + } + } + else if (CONSP (keys)) + { + /* In effect, this computes + (mapconcat 'single-key-description keys " ") + but we shouldn't use mapconcat because it can do GC. */ + + len = XFASTINT (Flength (keys)); + sep = build_string (" "); + /* This has one extra element at the end that we don't pass to Fconcat. */ + args = (Lisp_Object *) alloca (len * 2 * sizeof (Lisp_Object)); + + for (i = 0; i < len; i++) + { + args[i * 2] = Fsingle_key_description (XCONS (keys)->car); + args[i * 2 + 1] = sep; + keys = XCONS (keys)->cdr; + } + } + else keys = wrong_type_argument (Qarrayp, keys); - /* In effect, this computes - (mapconcat 'single-key-description keys " ") - but we shouldn't use mapconcat because it can do GC. */ - - len = XVECTOR (keys)->size; - sep = build_string (" "); - /* This has one extra element at the end that we don't pass to Fconcat. */ - args = (Lisp_Object *) alloca (len * 2 * sizeof (Lisp_Object)); - - for (i = 0; i < len; i++) - { - args[i * 2] = Fsingle_key_description (XVECTOR (keys)->contents[i]); - args[i * 2 + 1] = sep; - } - return Fconcat (len * 2 - 1, args); } @@ -1855,6 +1876,9 @@ (key) Lisp_Object key; { + if (CONSP (key) && lucid_event_type_list_p (key)) + key = Fevent_convert_list (key); + key = EVENT_HEAD (key); if (INTEGERP (key)) /* Normal character */