Commit 7d92e329 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Fkey_binding): Handle Voverriding_local_map.

(describe_buffer_bindings): Likewise.
parent 661b05a7
...@@ -80,6 +80,8 @@ Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii; ...@@ -80,6 +80,8 @@ Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii;
character. */ character. */
extern Lisp_Object meta_prefix_char; extern Lisp_Object meta_prefix_char;
extern Lisp_Object Voverriding_local_map;
void describe_map_tree (); void describe_map_tree ();
static Lisp_Object define_as_prefix (); static Lisp_Object define_as_prefix ();
static Lisp_Object describe_buffer_bindings (); static Lisp_Object describe_buffer_bindings ();
...@@ -819,6 +821,14 @@ recognize the default bindings, just as `read-key-sequence' does.") ...@@ -819,6 +821,14 @@ recognize the default bindings, just as `read-key-sequence' does.")
Lisp_Object *maps, value; Lisp_Object *maps, value;
int nmaps, i; int nmaps, i;
if (!NILP (Voverriding_local_map))
{
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); nmaps = current_minor_maps (0, &maps);
for (i = 0; i < nmaps; i++) for (i = 0; i < nmaps; i++)
if (! NILP (maps[i])) if (! NILP (maps[i]))
...@@ -834,6 +844,7 @@ recognize the default bindings, just as `read-key-sequence' does.") ...@@ -834,6 +844,7 @@ recognize the default bindings, just as `read-key-sequence' does.")
if (! NILP (value) && XTYPE (value) != Lisp_Int) if (! NILP (value) && XTYPE (value) != Lisp_Int)
return value; return value;
} }
}
value = Flookup_key (current_global_map, key, accept_default); value = Flookup_key (current_global_map, key, accept_default);
if (! NILP (value) && XTYPE (value) != Lisp_Int) if (! NILP (value) && XTYPE (value) != Lisp_Int)
...@@ -1731,6 +1742,9 @@ nominal alternate\n\ ...@@ -1731,6 +1742,9 @@ nominal alternate\n\
/* Temporarily switch to descbuf, so that we can get that buffer's /* Temporarily switch to descbuf, so that we can get that buffer's
minor modes correctly. */ minor modes correctly. */
Fset_buffer (descbuf); Fset_buffer (descbuf);
if (!NILP (Voverriding_local_map))
nmaps = 0;
else
nmaps = current_minor_maps (&modes, &maps); nmaps = current_minor_maps (&modes, &maps);
Fset_buffer (Vstandard_output); Fset_buffer (Vstandard_output);
...@@ -1767,7 +1781,11 @@ nominal alternate\n\ ...@@ -1767,7 +1781,11 @@ nominal alternate\n\
} }
/* Print the (major mode) local map. */ /* Print the (major mode) local map. */
if (!NILP (Voverriding_local_map))
start1 = Voverriding_local_map;
else
start1 = XBUFFER (descbuf)->keymap; start1 = XBUFFER (descbuf)->keymap;
if (!NILP (start1)) if (!NILP (start1))
{ {
describe_map_tree (start1, 0, shadow, prefix, describe_map_tree (start1, 0, shadow, prefix,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment