diff src/keyboard.c @ 32476:9b2a0dc393a4

* keymap.c (access_keymap): Add AUTOLOAD parameter. Do the meta->esc mapping. Call get_keyelt before returning. Start scanning from the second element (the first is always `keymap') to make it easier to detect when we reach a parent map. Handle the case of inheriting from a symbol whose function is a map. (Fkeymap_parent): Also handle the `inherit from symbol' case. (fix_submap_inheritance, Fdefine_key): Update call to access_keymap. (get_keyelt, Flookup_key): Update call to access_keymap. Remove the meta->esc mappings. (define_as_prefix): Delete old disabled code. (menu_item_p): New function. (where_is_internal_1): Skip over the few remaining menu items. * lisp.h (access_keymap): Update prototype. * keyboard.c (read_char, menu_bar_items, tool_bar_items): Update call to access_keymap. (follow_key, read_key_sequence): Update calls to access_keymap. Remove the meta->esc mappings.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 15 Oct 2000 03:31:21 +0000
parents 13415f4f854a
children 923b8d6d8277
line wrap: on
line diff
--- a/src/keyboard.c	Sun Oct 15 02:31:42 2000 +0000
+++ b/src/keyboard.c	Sun Oct 15 03:31:21 2000 +0000
@@ -2570,8 +2570,7 @@
      and loop around to read another event.  */
   save = Vquit_flag;
   Vquit_flag = Qnil;
-  tem = get_keyelt (access_keymap (get_keymap_1 (Vspecial_event_map, 0, 0),
-				   c, 0, 0), 1);
+  tem = access_keymap (get_keymap_1 (Vspecial_event_map, 0, 0), c, 0, 0, 1);
   Vquit_flag = save;
 
   if (!NILP (tem))
@@ -6254,7 +6253,7 @@
   for (mapno = nmaps - 1; mapno >= 0; mapno--)
     if (!NILP (maps[mapno]))
       {
-	def = get_keyelt (access_keymap (maps[mapno], Qmenu_bar, 1, 0), 0);
+	def = access_keymap (maps[mapno], Qmenu_bar, 1, 0, 0);
 	tem = Fkeymapp (def);
 	if (!NILP (tem))
 	  menu_bar_one_keymap (def);
@@ -6911,8 +6910,9 @@
     if (!NILP (maps[i]))
       {
 	Lisp_Object keymap;
-      
-	keymap = get_keyelt (access_keymap (maps[i], Qtool_bar, 1, 1), 0);
+
+	/* Why set the `noinherit' flag ?  -sm  */
+	keymap = access_keymap (maps[i], Qtool_bar, 1, 1, 0);
 	if (!NILP (Fkeymapp (keymap)))
 	  {
 	    Lisp_Object tail;
@@ -7599,31 +7599,6 @@
   int i, first_binding;
   int did_meta = 0;
 
-  /* If KEY is a meta ASCII character, treat it like meta-prefix-char
-     followed by the corresponding non-meta character.
-     Put the results into DEFS, since we are going to alter that anyway.
-     Do not alter CURRENT or NEXT.  */
-  if (INTEGERP (key) && (XUINT (key) & CHAR_META))
-    {
-      for (i = 0; i < nmaps; i++)
-	if (! NILP (current[i]))
-	  {
-	    Lisp_Object def;
-	    def = get_keyelt (access_keymap (current[i],
-					     meta_prefix_char, 1, 0), 0);
-
-	    /* Note that since we pass the resulting bindings through
-	       get_keymap_1, non-prefix bindings for meta-prefix-char
-	       disappear.  */
-	    defs[i] = get_keymap_1 (def, 0, 1);
-	  }
-	else
-	  defs[i] = Qnil;
-
-      did_meta = 1;
-      XSETINT (key, XFASTINT (key) & ~CHAR_META);
-    }
-
   first_binding = nmaps;
   for (i = nmaps - 1; i >= 0; i--)
     {
@@ -7635,7 +7610,7 @@
 	  else
 	    map = current[i];
 
-	  defs[i] = get_keyelt (access_keymap (map, key, 1, 0), 1);
+	  defs[i] = access_keymap (map, key, 1, 0, 1);
 	  if (! NILP (defs[i]))
 	    first_binding = i;
 	}
@@ -8457,22 +8432,8 @@
 	      Lisp_Object key;
 
 	      key = keybuf[fkey_end++];
-	      /* Look up meta-characters by prefixing them
-		 with meta_prefix_char.  I hate this.  */
-	      if (INTEGERP (key) && XUINT (key) & meta_modifier)
-		{
-		  fkey_next
-		    = get_keymap_1
-		      (get_keyelt
-		       (access_keymap (fkey_map, meta_prefix_char, 1, 0), 0),
-		       0, 1);
-		  XSETFASTINT (key, XFASTINT (key) & ~meta_modifier);
-		}
-	      else
-		fkey_next = fkey_map;
-
 	      fkey_next
-		= get_keyelt (access_keymap (fkey_next, key, 1, 0), 1);
+		= access_keymap (fkey_map, key, 1, 0, 1);
 
 	      /* Handle symbol with autoload definition.  */
 	      if (SYMBOLP (fkey_next) && ! NILP (Ffboundp (fkey_next))
@@ -8581,22 +8542,8 @@
 	    Lisp_Object key;
 
 	    key = keybuf[keytran_end++];
-	    /* Look up meta-characters by prefixing them
-	       with meta_prefix_char.  I hate this.  */
-	    if (INTEGERP (key) && XUINT (key) & meta_modifier)
-	      {
-		keytran_next
-		  = get_keymap_1
-		    (get_keyelt
-		     (access_keymap (keytran_map, meta_prefix_char, 1, 0), 0),
-		     0, 1);
-		XSETFASTINT (key, XFASTINT (key) & ~meta_modifier);
-	      }
-	    else
-	      keytran_next = keytran_map;
-
 	    keytran_next
-	      = get_keyelt (access_keymap (keytran_next, key, 1, 0), 1);
+	      = access_keymap (keytran_map, key, 1, 0, 1);
 
 	    /* Handle symbol with autoload definition.  */
 	    if (SYMBOLP (keytran_next) && ! NILP (Ffboundp (keytran_next))