diff options
| author | Stefan Monnier | 2012-06-02 15:21:34 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-06-02 15:21:34 -0400 |
| commit | f2d6a3df6ab288a909ad3dc9fcadfdb28e46f2ee (patch) | |
| tree | 496b84ebd6cbe2bd04405dac1a3a951d82f6cb3d /lisp | |
| parent | 7bd5c1f4a4abb97576a26d6b0a9691c5f530d99f (diff) | |
| download | emacs-f2d6a3df6ab288a909ad3dc9fcadfdb28e46f2ee.tar.gz emacs-f2d6a3df6ab288a909ad3dc9fcadfdb28e46f2ee.zip | |
* 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 @@ | |||
| 1 | 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * simple.el (execute-extended-command): Set real-this-command | ||
| 4 | (bug#11506). | ||
| 5 | |||
| 1 | 2012-06-02 Chong Yidong <cyd@gnu.org> | 6 | 2012-06-02 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | Remove incorrect uses of "modeline" in comments, docstrings, and | 8 | 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." | |||
| 1378 | (if (null command-name) (setq command-name (read-extended-command))) | 1378 | (if (null command-name) (setq command-name (read-extended-command))) |
| 1379 | (let* ((function (and (stringp command-name) (intern-soft command-name))) | 1379 | (let* ((function (and (stringp command-name) (intern-soft command-name))) |
| 1380 | (binding (and suggest-key-bindings | 1380 | (binding (and suggest-key-bindings |
| 1381 | (not executing-kbd-macro) | 1381 | (not executing-kbd-macro) |
| 1382 | (where-is-internal function overriding-local-map t)))) | 1382 | (where-is-internal function overriding-local-map t)))) |
| 1383 | (unless (commandp function) | 1383 | (unless (commandp function) |
| 1384 | (error "`%s' is not a valid command name" command-name)) | 1384 | (error "`%s' is not a valid command name" command-name)) |
| 1385 | ;; Set this_command_keys to the concatenation of saved-keys and | ||
| 1386 | ;; function, followed by a RET. | ||
| 1387 | (setq this-command function) | 1385 | (setq this-command function) |
| 1386 | ;; Normally `real-this-command' should never be changed, but here we really | ||
| 1387 | ;; want to pretend that M-x <cmd> RET is nothing more than a "key | ||
| 1388 | ;; binding" for <cmd>, so the command the user really wanted to run is | ||
| 1389 | ;; `function' and not `execute-extended-command'. The difference is | ||
| 1390 | ;; visible in cases such as M-x <cmd> RET and then C-x z (bug#11506). | ||
| 1391 | (setq real-this-command function) | ||
| 1388 | (let ((prefix-arg prefixarg)) | 1392 | (let ((prefix-arg prefixarg)) |
| 1389 | (command-execute function 'record)) | 1393 | (command-execute function 'record)) |
| 1390 | ;; If enabled, show which key runs this command. | 1394 | ;; If enabled, show which key runs this command. |