diff options
| author | Richard M. Stallman <rms@gnu.org> | 1997-04-19 22:52:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1997-04-19 22:52:28 +0000 |
| commit | 67fc16a3bf80ca4736af9d21093adc84ca7d4e17 (patch) | |
| tree | 2006070fb8ee91298f0e38873054fa1943163a5a | |
| parent | d27497e33a7a90c593a4ece376151988547dc0ee (diff) | |
| download | emacs-67fc16a3bf80ca4736af9d21093adc84ca7d4e17.tar.gz | |
(Faccessible_keymaps): Convert PREFIX to a vector
at the beginning, if it has any definition.
| -rw-r--r-- | src/keymap.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/keymap.c b/src/keymap.c index b860b7565a3..e042f64a099 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -1300,7 +1300,26 @@ then the value includes only maps for prefixes that start with PREFIX.") It might even give us a list that isn't a keymap. */ tem = get_keymap_1 (tem, 0, 0); if (!NILP (tem)) - maps = Fcons (Fcons (prefix, tem), Qnil); + { + /* Convert PREFIX to a vector now, so that later on + we don't have to deal with the possibility of a string. */ + if (STRINGP (prefix)) + { + int i; + Lisp_Object copy; + + copy = Fmake_vector (make_number (XSTRING (prefix)->size), Qnil); + for (i = 0; i < XSTRING (prefix)->size; i++) + { + int c = XSTRING (prefix)->data[i]; + if (c & 0200) + c ^= 0200 | meta_modifier; + XVECTOR (copy)->contents[i] = make_number (c); + } + prefix = copy; + } + maps = Fcons (Fcons (prefix, tem), Qnil); + } else return Qnil; } |
