diff options
| author | Richard M. Stallman | 1994-01-16 23:39:50 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-01-16 23:39:50 +0000 |
| commit | 7d92e3291af6581697f71f1cc8fda3af1c14e33f (patch) | |
| tree | 82616f3e7557f7b36be585b5aa330042dd7a157e /src/keymap.c | |
| parent | 661b05a712475f3f81fc00e7116fd4c48e6fcaf3 (diff) | |
| download | emacs-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.c | 44 |
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. */ |
| 81 | extern Lisp_Object meta_prefix_char; | 81 | extern Lisp_Object meta_prefix_char; |
| 82 | 82 | ||
| 83 | extern Lisp_Object Voverriding_local_map; | ||
| 84 | |||
| 83 | void describe_map_tree (); | 85 | void describe_map_tree (); |
| 84 | static Lisp_Object define_as_prefix (); | 86 | static Lisp_Object define_as_prefix (); |
| 85 | static Lisp_Object describe_buffer_bindings (); | 87 | static 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, |