aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 4ffb071272c..7f539fd57b5 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -97,6 +97,7 @@ Lisp_Object Vemulation_mode_map_alists;
97Lisp_Object Vdefine_key_rebound_commands; 97Lisp_Object Vdefine_key_rebound_commands;
98 98
99Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item, Qremap; 99Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item, Qremap;
100Lisp_Object QCadvertised_binding;
100 101
101/* Alist of elements like (DEL . "\d"). */ 102/* Alist of elements like (DEL . "\d"). */
102static Lisp_Object exclude_keys; 103static Lisp_Object exclude_keys;
@@ -2818,6 +2819,7 @@ remapped command in the returned list. */)
2818 because remapping is not done recursively by Fcommand_remapping: you 2819 because remapping is not done recursively by Fcommand_remapping: you
2819 can't remap and remapped command. */ 2820 can't remap and remapped command. */
2820 int remapped = 0; 2821 int remapped = 0;
2822 Lisp_Object tem;
2821 2823
2822 /* Refresh the C version of the modifier preference. */ 2824 /* Refresh the C version of the modifier preference. */
2823 where_is_preferred_modifier 2825 where_is_preferred_modifier
@@ -2843,6 +2845,20 @@ remapped command in the returned list. */)
2843 && !NILP (Fcommand_remapping (definition, Qnil, keymaps))) 2845 && !NILP (Fcommand_remapping (definition, Qnil, keymaps)))
2844 RETURN_UNGCPRO (Qnil); 2846 RETURN_UNGCPRO (Qnil);
2845 2847
2848 if (SYMBOLP (definition)
2849 && !NILP (firstonly)
2850 && !NILP (tem = Fget (definition, QCadvertised_binding)))
2851 {
2852 /* We have a list of advertized bindings. */
2853 while (CONSP (tem))
2854 if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil), definition))
2855 return XCAR (tem);
2856 else
2857 tem = XCDR (tem);
2858 if (EQ (shadow_lookup (keymaps, tem, Qnil), definition))
2859 return tem;
2860 }
2861
2846 sequences = Freverse (where_is_internal (definition, keymaps, 2862 sequences = Freverse (where_is_internal (definition, keymaps,
2847 !NILP (noindirect), nomenus)); 2863 !NILP (noindirect), nomenus));
2848 2864
@@ -4036,6 +4052,9 @@ preferred. */);
4036 Qremap = intern ("remap"); 4052 Qremap = intern ("remap");
4037 staticpro (&Qremap); 4053 staticpro (&Qremap);
4038 4054
4055 QCadvertised_binding = intern (":advertised-binding");
4056 staticpro (&QCadvertised_binding);
4057
4039 command_remapping_vector = Fmake_vector (make_number (2), Qremap); 4058 command_remapping_vector = Fmake_vector (make_number (2), Qremap);
4040 staticpro (&command_remapping_vector); 4059 staticpro (&command_remapping_vector);
4041 4060