aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2009-09-11 00:58:59 +0000
committerStefan Monnier2009-09-11 00:58:59 +0000
commit8cb95edf7cdec140efb1c8dbf4f7f33320f0ca0c (patch)
tree082de7005695b6792640b4a2d54cfbe4a67921fc /src
parent599498c31f0ce7a3ffd6094a12a986766b5a694d (diff)
downloademacs-8cb95edf7cdec140efb1c8dbf4f7f33320f0ca0c.tar.gz
emacs-8cb95edf7cdec140efb1c8dbf4f7f33320f0ca0c.zip
* keymap.c (QCadvertised_binding): New constant.
(syms_of_keymap): Initialize it. (Fwhere_is_internal): Try and use bindings from :advertised-binding if applicable. * progmodes/xscheme.el (xscheme-evaluation-commands): Put a :advertised-binding property rather than using advertised-xscheme-send-previous-expression. (advertised-xscheme-send-previous-expression): Declare obsolete. * emulation/crisp.el (crisp-mode-map): Use `undo' rather than `advertised-undo'. (crisp-mode): Add corresponding bindings to undo's :advertised-binding instead. * dired.el (dired-mode-map): Put a :advertised-binding property rather than using dired-advertised-find-file. (dired-advertised-find-file): * simple.el (advertised-undo): * wid-edit.el (advertised-widget-backward): Declare obsolete. (widget-keymap): Put a :advertised-binding property rather than using advertised-widget-backward. * bindings.el (ctl-x-map): Put a :advertised-binding property rather than using advertised-undo. * tutorial.el (tutorial--default-keys): Adjust accordingly.
Diffstat (limited to 'src')
-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