changeset 17510:2da99276d613

(Faccessible_keymaps): Convert PREFIX to a vector at the beginning, if it has any definition.
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Apr 1997 22:52:28 +0000
parents 0c38918fbf13
children 10ead0052174
files src/keymap.c
diffstat 1 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/keymap.c	Fri Apr 18 19:12:24 1997 +0000
+++ b/src/keymap.c	Sat Apr 19 22:52:28 1997 +0000
@@ -1300,7 +1300,26 @@
 	 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;
     }