# HG changeset patch # User Richard M. Stallman # Date 758763590 0 # Node ID cad51b2de6cd1deab7d5ad94efaacb7e7b1acbec # Parent bf68550ececf1f696a89a20609007eb293c9de35 (Fkey_binding): Handle Voverriding_local_map. (describe_buffer_bindings): Likewise. diff -r bf68550ececf -r cad51b2de6cd src/keymap.c --- a/src/keymap.c Sun Jan 16 21:25:09 1994 +0000 +++ b/src/keymap.c Sun Jan 16 23:39:50 1994 +0000 @@ -80,6 +80,8 @@ character. */ extern Lisp_Object meta_prefix_char; +extern Lisp_Object Voverriding_local_map; + void describe_map_tree (); static Lisp_Object define_as_prefix (); static Lisp_Object describe_buffer_bindings (); @@ -819,21 +821,30 @@ Lisp_Object *maps, value; int nmaps, i; - nmaps = current_minor_maps (0, &maps); - for (i = 0; i < nmaps; i++) - if (! NILP (maps[i])) - { - value = Flookup_key (maps[i], key, accept_default); - if (! NILP (value) && XTYPE (value) != Lisp_Int) - return value; - } - - if (! NILP (current_buffer->keymap)) + if (!NILP (Voverriding_local_map)) { - value = Flookup_key (current_buffer->keymap, key, accept_default); + value = Flookup_key (Voverriding_local_map, key, accept_default); if (! NILP (value) && XTYPE (value) != Lisp_Int) return value; } + else + { + nmaps = current_minor_maps (0, &maps); + for (i = 0; i < nmaps; i++) + if (! NILP (maps[i])) + { + value = Flookup_key (maps[i], key, accept_default); + if (! NILP (value) && XTYPE (value) != Lisp_Int) + return value; + } + + if (! NILP (current_buffer->keymap)) + { + value = Flookup_key (current_buffer->keymap, key, accept_default); + if (! NILP (value) && XTYPE (value) != Lisp_Int) + return value; + } + } value = Flookup_key (current_global_map, key, accept_default); if (! NILP (value) && XTYPE (value) != Lisp_Int) @@ -1731,7 +1742,10 @@ /* Temporarily switch to descbuf, so that we can get that buffer's minor modes correctly. */ Fset_buffer (descbuf); - nmaps = current_minor_maps (&modes, &maps); + if (!NILP (Voverriding_local_map)) + nmaps = 0; + else + nmaps = current_minor_maps (&modes, &maps); Fset_buffer (Vstandard_output); /* Print the minor mode maps. */ @@ -1767,7 +1781,11 @@ } /* Print the (major mode) local map. */ - start1 = XBUFFER (descbuf)->keymap; + if (!NILP (Voverriding_local_map)) + start1 = Voverriding_local_map; + else + start1 = XBUFFER (descbuf)->keymap; + if (!NILP (start1)) { describe_map_tree (start1, 0, shadow, prefix,