aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1994-01-16 23:39:50 +0000
committerRichard M. Stallman <[email protected]>1994-01-16 23:39:50 +0000
commit7d92e3291af6581697f71f1cc8fda3af1c14e33f (patch)
tree82616f3e7557f7b36be585b5aa330042dd7a157e /src/keymap.c
parent661b05a712475f3f81fc00e7116fd4c48e6fcaf3 (diff)
(Fkey_binding): Handle Voverriding_local_map.
(describe_buffer_bindings): Likewise.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c44
1 files changed, 31 insertions, 13 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 23cef9a0c8..e512dcce25 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -80,6 +80,8 @@ Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii;
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 @@ recognize the default bindings, just as `read-key-sequence' does.")
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 @@ nominal alternate\n\
/* 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 @@ nominal alternate\n\
}
/* 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,