aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2017-02-10 10:57:41 +0200
committerEli Zaretskii2017-02-10 10:57:41 +0200
commit937bf04804246c86a4b1bd55b506169f5a894e3b (patch)
tree68f36cd97f8f2e63c426dd30028d0f451f6f510e /src
parentd825d1f28decd671feb71c7657d41d0502ab5cf5 (diff)
downloademacs-937bf04804246c86a4b1bd55b506169f5a894e3b.tar.gz
emacs-937bf04804246c86a4b1bd55b506169f5a894e3b.zip
Restore special setting of this-command-keys by M-x
It was lost when execute-extended-command was reimplemented in Lisp. * src/keyboard.c (Fset__this_command_keys): New function. (syms_of_keyboard): Defsubr it. * lisp/simple.el (execute-extended-command): Set this-command-keys as novice.el expects. (Bug#25612)
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index a86e7c5f8e4..168232203fe 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10001,6 +10001,30 @@ See also `this-command-keys-vector'. */)
10001 XVECTOR (this_command_keys)->contents); 10001 XVECTOR (this_command_keys)->contents);
10002} 10002}
10003 10003
10004DEFUN ("set--this-command-keys", Fset__this_command_keys,
10005 Sset__this_command_keys, 1, 1, 0,
10006 doc: /* Set the vector to be returned by `this-command-keys'.
10007The argument KEYS must be a string.
10008Internal use only. */)
10009 (Lisp_Object keys)
10010{
10011 CHECK_STRING (keys);
10012
10013 this_command_key_count = 0;
10014 this_single_command_key_start = 0;
10015 int key0 = SREF (keys, 0);
10016
10017 /* Kludge alert: this makes M-x be in the form expected by
10018 novice.el. Any better ideas? */
10019 if (key0 == 248)
10020 add_command_key (make_number ('x' | meta_modifier));
10021 else
10022 add_command_key (make_number (key0));
10023 for (int i = 1; i < SCHARS (keys); i++)
10024 add_command_key (make_number (SREF (keys, i)));
10025 return Qnil;
10026}
10027
10004DEFUN ("this-command-keys-vector", Fthis_command_keys_vector, Sthis_command_keys_vector, 0, 0, 0, 10028DEFUN ("this-command-keys-vector", Fthis_command_keys_vector, Sthis_command_keys_vector, 0, 0, 0,
10005 doc: /* Return the key sequence that invoked this command, as a vector. 10029 doc: /* Return the key sequence that invoked this command, as a vector.
10006However, if the command has called `read-key-sequence', it returns 10030However, if the command has called `read-key-sequence', it returns
@@ -11211,6 +11235,7 @@ syms_of_keyboard (void)
11211 defsubr (&Sthis_command_keys_vector); 11235 defsubr (&Sthis_command_keys_vector);
11212 defsubr (&Sthis_single_command_keys); 11236 defsubr (&Sthis_single_command_keys);
11213 defsubr (&Sthis_single_command_raw_keys); 11237 defsubr (&Sthis_single_command_raw_keys);
11238 defsubr (&Sset__this_command_keys);
11214 defsubr (&Sclear_this_command_keys); 11239 defsubr (&Sclear_this_command_keys);
11215 defsubr (&Ssuspend_emacs); 11240 defsubr (&Ssuspend_emacs);
11216 defsubr (&Sabort_recursive_edit); 11241 defsubr (&Sabort_recursive_edit);