aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-01-16 23:39:50 +0000
committerRichard M. Stallman1994-01-16 23:39:50 +0000
commit7d92e3291af6581697f71f1cc8fda3af1c14e33f (patch)
tree82616f3e7557f7b36be585b5aa330042dd7a157e /src/keymap.c
parent661b05a712475f3f81fc00e7116fd4c48e6fcaf3 (diff)
downloademacs-7d92e3291af6581697f71f1cc8fda3af1c14e33f.tar.gz
emacs-7d92e3291af6581697f71f1cc8fda3af1c14e33f.zip
(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 23cef9a0c87..e512dcce258 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -80,6 +80,8 @@ Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii;
80 character. */ 80 character. */
81extern Lisp_Object meta_prefix_char; 81extern Lisp_Object meta_prefix_char;
82 82
83extern Lisp_Object Voverriding_local_map;
84
83void describe_map_tree (); 85void describe_map_tree ();
84static Lisp_Object define_as_prefix (); 86static Lisp_Object define_as_prefix ();
85static Lisp_Object describe_buffer_bindings (); 87static Lisp_Object describe_buffer_bindings ();
@@ -819,21 +821,30 @@ recognize the default bindings, just as `read-key-sequence' does.")
819 Lisp_Object *maps, value; 821 Lisp_Object *maps, value;
820 int nmaps, i; 822 int nmaps, i;
821 823
822 nmaps = current_minor_maps (0, &maps); 824 if (!NILP (Voverriding_local_map))
823 for (i = 0; i < nmaps; i++)
824 if (! NILP (maps[i]))
825 {
826 value = Flookup_key (maps[i], key, accept_default);
827 if (! NILP (value) && XTYPE (value) != Lisp_Int)
828 return value;
829 }
830
831 if (! NILP (current_buffer->keymap))
832 { 825 {
833 value = Flookup_key (current_buffer->keymap, key, accept_default); 826 value = Flookup_key (Voverriding_local_map, key, accept_default);
834 if (! NILP (value) && XTYPE (value) != Lisp_Int) 827 if (! NILP (value) && XTYPE (value) != Lisp_Int)
835 return value; 828 return value;
836 } 829 }
830 else
831 {
832 nmaps = current_minor_maps (0, &maps);
833 for (i = 0; i < nmaps; i++)
834 if (! NILP (maps[i]))
835 {
836 value = Flookup_key (maps[i], key, accept_default);
837 if (! NILP (value) && XTYPE (value) != Lisp_Int)
838 return value;
839 }
840
841 if (! NILP (current_buffer->keymap))
842 {
843 value = Flookup_key (current_buffer->keymap, key, accept_default);
844 if (! NILP (value) && XTYPE (value) != Lisp_Int)
845 return value;
846 }
847 }
837 848
838 value = Flookup_key (current_global_map, key, accept_default); 849 value = Flookup_key (current_global_map, key, accept_default);
839 if (! NILP (value) && XTYPE (value) != Lisp_Int) 850 if (! NILP (value) && XTYPE (value) != Lisp_Int)
@@ -1731,7 +1742,10 @@ nominal alternate\n\
1731 /* Temporarily switch to descbuf, so that we can get that buffer's 1742 /* Temporarily switch to descbuf, so that we can get that buffer's
1732 minor modes correctly. */ 1743 minor modes correctly. */
1733 Fset_buffer (descbuf); 1744 Fset_buffer (descbuf);
1734 nmaps = current_minor_maps (&modes, &maps); 1745 if (!NILP (Voverriding_local_map))
1746 nmaps = 0;
1747 else
1748 nmaps = current_minor_maps (&modes, &maps);
1735 Fset_buffer (Vstandard_output); 1749 Fset_buffer (Vstandard_output);
1736 1750
1737 /* Print the minor mode maps. */ 1751 /* Print the minor mode maps. */
@@ -1767,7 +1781,11 @@ nominal alternate\n\
1767 } 1781 }
1768 1782
1769 /* Print the (major mode) local map. */ 1783 /* Print the (major mode) local map. */
1770 start1 = XBUFFER (descbuf)->keymap; 1784 if (!NILP (Voverriding_local_map))
1785 start1 = Voverriding_local_map;
1786 else
1787 start1 = XBUFFER (descbuf)->keymap;
1788
1771 if (!NILP (start1)) 1789 if (!NILP (start1))
1772 { 1790 {
1773 describe_map_tree (start1, 0, shadow, prefix, 1791 describe_map_tree (start1, 0, shadow, prefix,