summaryrefslogtreecommitdiff
path: root/src/keymap.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2006-07-22 21:22:52 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2006-07-22 21:22:52 +0000
commit2db8f1738723969e558e3e9417ef3dff39ab7bf1 (patch)
tree5ef427e1bcdd21f83fcc63574ee2fe9de8a1a4cb /src/keymap.c
parentb9debd5432b6d2e6fca6cda14f19a27c075717de (diff)
downloademacs-2db8f1738723969e558e3e9417ef3dff39ab7bf1.tar.gz
(Fdefine_key): If the key binding definition looks like an
XEmacs-style key sequence, convert it to Emacs's format.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 71fd5f03390..4871179c420 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1149,6 +1149,20 @@ binding KEY to DEF is added at the front of KEYMAP. */)
meta_bit = VECTORP (key) ? meta_modifier : 0x80;
+ if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, make_number (0))))
+ { /* DEF is apparently an XEmacs-style keyboard macro. */
+ Lisp_Object tmp = Fmake_vector (make_number (ASIZE (def)), Qnil);
+ int i = ASIZE (def);
+ while (--i >= 0)
+ {
+ Lisp_Object c = AREF (def, i);
+ if (CONSP (c) && lucid_event_type_list_p (c))
+ c = Fevent_convert_list (c);
+ ASET (tmp, i, c);
+ }
+ def = tmp;
+ }
+
idx = 0;
while (1)
{