summaryrefslogtreecommitdiff
path: root/src/keymap.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-09-11 00:58:59 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-09-11 00:58:59 +0000
commit8cb95edf7cdec140efb1c8dbf4f7f33320f0ca0c (patch)
tree082de7005695b6792640b4a2d54cfbe4a67921fc /src/keymap.c
parent599498c31f0ce7a3ffd6094a12a986766b5a694d (diff)
downloademacs-8cb95edf7cdec140efb1c8dbf4f7f33320f0ca0c.tar.gz
* 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/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;
Lisp_Object Vdefine_key_rebound_commands;
Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item, Qremap;
+Lisp_Object QCadvertised_binding;
/* Alist of elements like (DEL . "\d"). */
static Lisp_Object exclude_keys;
@@ -2818,6 +2819,7 @@ remapped command in the returned list. */)
because remapping is not done recursively by Fcommand_remapping: you
can't remap and remapped command. */
int remapped = 0;
+ Lisp_Object tem;
/* Refresh the C version of the modifier preference. */
where_is_preferred_modifier
@@ -2843,6 +2845,20 @@ remapped command in the returned list. */)
&& !NILP (Fcommand_remapping (definition, Qnil, keymaps)))
RETURN_UNGCPRO (Qnil);
+ if (SYMBOLP (definition)
+ && !NILP (firstonly)
+ && !NILP (tem = Fget (definition, QCadvertised_binding)))
+ {
+ /* We have a list of advertized bindings. */
+ while (CONSP (tem))
+ if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil), definition))
+ return XCAR (tem);
+ else
+ tem = XCDR (tem);
+ if (EQ (shadow_lookup (keymaps, tem, Qnil), definition))
+ return tem;
+ }
+
sequences = Freverse (where_is_internal (definition, keymaps,
!NILP (noindirect), nomenus));
@@ -4036,6 +4052,9 @@ preferred. */);
Qremap = intern ("remap");
staticpro (&Qremap);
+ QCadvertised_binding = intern (":advertised-binding");
+ staticpro (&QCadvertised_binding);
+
command_remapping_vector = Fmake_vector (make_number (2), Qremap);
staticpro (&command_remapping_vector);