aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2006-07-22 21:22:52 +0000
committerStefan Monnier2006-07-22 21:22:52 +0000
commit2db8f1738723969e558e3e9417ef3dff39ab7bf1 (patch)
tree5ef427e1bcdd21f83fcc63574ee2fe9de8a1a4cb
parentb9debd5432b6d2e6fca6cda14f19a27c075717de (diff)
downloademacs-2db8f1738723969e558e3e9417ef3dff39ab7bf1.tar.gz
emacs-2db8f1738723969e558e3e9417ef3dff39ab7bf1.zip
(Fdefine_key): If the key binding definition looks like an
XEmacs-style key sequence, convert it to Emacs's format.
-rw-r--r--etc/NEWS2
-rw-r--r--src/ChangeLog5
-rw-r--r--src/keymap.c14
3 files changed, 21 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index f06bee9badc..4a2eaf4e225 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -4617,6 +4617,8 @@ Lisp packages using many minor mode keymaps can now maintain their own
4617keymap alist separate from `minor-mode-map-alist' by adding their 4617keymap alist separate from `minor-mode-map-alist' by adding their
4618keymap alist to this list. 4618keymap alist to this list.
4619 4619
4620*** The definition of a key-binding passed to define-key can use XEmacs-style
4621key-sequences, such as [(control a)].
4620** Abbrev changes: 4622** Abbrev changes:
4621 4623
4622+++ 4624+++
diff --git a/src/ChangeLog b/src/ChangeLog
index 628d5dba0a9..10a525f8a3f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12006-07-22 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * keymap.c (Fdefine_key): If the key binding definition looks like an
4 XEmacs-style key sequence, convert it to Emacs's format.
5
12006-07-22 Ralf Angeli <angeli@caeruleus.net> 62006-07-22 Ralf Angeli <angeli@caeruleus.net>
2 7
3 * w32fns.c (w32_createwindow): If `left' and/or `top' frame 8 * w32fns.c (w32_createwindow): If `left' and/or `top' frame
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. */)
1149 1149
1150 meta_bit = VECTORP (key) ? meta_modifier : 0x80; 1150 meta_bit = VECTORP (key) ? meta_modifier : 0x80;
1151 1151
1152 if (VECTORP (def) && ASIZE (def) > 0 && CONSP (AREF (def, make_number (0))))
1153 { /* DEF is apparently an XEmacs-style keyboard macro. */
1154 Lisp_Object tmp = Fmake_vector (make_number (ASIZE (def)), Qnil);
1155 int i = ASIZE (def);
1156 while (--i >= 0)
1157 {
1158 Lisp_Object c = AREF (def, i);
1159 if (CONSP (c) && lucid_event_type_list_p (c))
1160 c = Fevent_convert_list (c);
1161 ASET (tmp, i, c);
1162 }
1163 def = tmp;
1164 }
1165
1152 idx = 0; 1166 idx = 0;
1153 while (1) 1167 while (1)
1154 { 1168 {