diff options
| author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-02 15:21:34 -0400 |
|---|---|---|
| committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-02 15:21:34 -0400 |
| commit | f2d6a3df6ab288a909ad3dc9fcadfdb28e46f2ee (patch) | |
| tree | 496b84ebd6cbe2bd04405dac1a3a951d82f6cb3d /lisp | |
| parent | 7bd5c1f4a4abb97576a26d6b0a9691c5f530d99f (diff) | |
| download | emacs-f2d6a3df6ab288a909ad3dc9fcadfdb28e46f2ee.tar.gz | |
* lisp/simple.el (execute-extended-command): Set real-this-command.
* src/keyboard.c: Export real-this-command to Elisp.
(syms_of_keyboard): Rename real_this_command to Vreal_this_command
and DEFVAR it. Update all users.
Fixes: debbugs:11506
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/simple.el | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b973d09fc43..e39b8a64205 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * simple.el (execute-extended-command): Set real-this-command + (bug#11506). + 2012-06-02 Chong Yidong <cyd@gnu.org> Remove incorrect uses of "modeline" in comments, docstrings, and diff --git a/lisp/simple.el b/lisp/simple.el index 561d3656eb7..655298e4fea 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1378,13 +1378,17 @@ give to the command you invoke, if it asks for an argument." (if (null command-name) (setq command-name (read-extended-command))) (let* ((function (and (stringp command-name) (intern-soft command-name))) (binding (and suggest-key-bindings - (not executing-kbd-macro) - (where-is-internal function overriding-local-map t)))) + (not executing-kbd-macro) + (where-is-internal function overriding-local-map t)))) (unless (commandp function) (error "`%s' is not a valid command name" command-name)) - ;; Set this_command_keys to the concatenation of saved-keys and - ;; function, followed by a RET. (setq this-command function) + ;; Normally `real-this-command' should never be changed, but here we really + ;; want to pretend that M-x <cmd> RET is nothing more than a "key + ;; binding" for <cmd>, so the command the user really wanted to run is + ;; `function' and not `execute-extended-command'. The difference is + ;; visible in cases such as M-x <cmd> RET and then C-x z (bug#11506). + (setq real-this-command function) (let ((prefix-arg prefixarg)) (command-execute function 'record)) ;; If enabled, show which key runs this command. |
