diff options
| author | Po Lu | 2025-03-02 16:00:33 +0800 |
|---|---|---|
| committer | Po Lu | 2025-03-02 16:05:04 +0800 |
| commit | 7fcb01e76ba9b2c74019f3863975cfe32c8b0da0 (patch) | |
| tree | 09765f683c7f167a3897b0db6d11632477cd3a0d | |
| parent | 558e6792c0a920a691b6c70fd7eda6b5c6e85a80 (diff) | |
| download | emacs-7fcb01e76ba9b2c74019f3863975cfe32c8b0da0.tar.gz emacs-7fcb01e76ba9b2c74019f3863975cfe32c8b0da0.zip | |
Enable kmacro-call-macro to function in some circumstances
* lisp/kmacro.el (kmacro-call-macro): Enable to function when
the selected frame's terminal is different from that most
recently consulted by the event loop.
| -rw-r--r-- | lisp/kmacro.el | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 43d0bfa23aa..b82c7b28c26 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el | |||
| @@ -775,8 +775,20 @@ use \\[kmacro-name-last-macro]." | |||
| 775 | last-input-event))) | 775 | last-input-event))) |
| 776 | (if end-macro | 776 | (if end-macro |
| 777 | (kmacro-end-macro arg) ; modifies last-kbd-macro | 777 | (kmacro-end-macro arg) ; modifies last-kbd-macro |
| 778 | ;; The effect of Fcall_last_kbd_macro must be reimplemented in | ||
| 779 | ;; Lisp, as the binding of `last-kbd-macro' might not take effect | ||
| 780 | ;; in the C function if the selected frame's terminal is not | ||
| 781 | ;; assigned as the current keyboard. | ||
| 778 | (let ((last-kbd-macro (or macro last-kbd-macro))) | 782 | (let ((last-kbd-macro (or macro last-kbd-macro))) |
| 779 | (call-last-kbd-macro arg #'kmacro-loop-setup-function))) | 783 | (setq this-command last-command) |
| 784 | (setq real-this-command last-kbd-macro) | ||
| 785 | (when defining-kbd-macro | ||
| 786 | (error "Can't execute anonymous macro while defining one")) | ||
| 787 | (unless last-kbd-macro | ||
| 788 | (error "No kbd macro has been defined")) | ||
| 789 | (execute-kbd-macro last-kbd-macro arg | ||
| 790 | #'kmacro-loop-setup-function) | ||
| 791 | (setq this-command last-command))) | ||
| 780 | (when (consp arg) | 792 | (when (consp arg) |
| 781 | (setq arg (car arg))) | 793 | (setq arg (car arg))) |
| 782 | (when (and (or (null arg) (> arg 0)) | 794 | (when (and (or (null arg) (> arg 0)) |