diff options
| author | Stefan Monnier | 2026-03-27 08:43:39 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2026-03-27 08:54:14 -0400 |
| commit | db412283d6b4fb8ea9d48629add952bf8fe2f423 (patch) | |
| tree | 92abfea55102ebb0de85975fa9ea2be7fd6af2f6 | |
| parent | 07baef0afffe1a163e0e07dcccd7e814c8b0b4a0 (diff) | |
| download | emacs-db412283d6b4fb8ea9d48629add952bf8fe2f423.tar.gz emacs-db412283d6b4fb8ea9d48629add952bf8fe2f423.zip | |
(kmacro-end-call-mouse): Make obsolete
* lisp/kmacro.el (kmacro-end-and-call-macro): Add EVENT argument.
(kmacro-end-call-mouse): Define as obsolete alias
of `kmacro-end-and-call-macro`.
| -rw-r--r-- | lisp/kmacro.el | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 982ae38f47d..b88c716f0b3 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el | |||
| @@ -219,7 +219,7 @@ macro to be executed before appending to it." | |||
| 219 | ;;;###autoload (autoload 'kmacro-keymap "kmacro" "Keymap for keyboard macro commands." t 'keymap) | 219 | ;;;###autoload (autoload 'kmacro-keymap "kmacro" "Keymap for keyboard macro commands." t 'keymap) |
| 220 | 220 | ||
| 221 | (if kmacro-call-mouse-event | 221 | (if kmacro-call-mouse-event |
| 222 | (global-set-key (vector kmacro-call-mouse-event) #'kmacro-end-call-mouse)) | 222 | (global-set-key (vector kmacro-call-mouse-event) #'kmacro-end-and-call-macro)) |
| 223 | 223 | ||
| 224 | 224 | ||
| 225 | ;;; Called from keyboard-quit | 225 | ;;; Called from keyboard-quit |
| @@ -742,8 +742,8 @@ With numeric ARG, repeat the macro that many times, | |||
| 742 | counting the definition just completed as the first repetition. | 742 | counting the definition just completed as the first repetition. |
| 743 | An argument of zero means repeat until error." | 743 | An argument of zero means repeat until error." |
| 744 | (interactive "p") | 744 | (interactive "p") |
| 745 | ;; Isearch may push the kmacro-end-macro key sequence onto the macro. | 745 | ;; Isearch may push the kmacro-end-macro key sequence onto the macro. |
| 746 | ;; Just ignore it when executing the macro. | 746 | ;; Just ignore it when executing the macro. FIXME: When?Why? |
| 747 | (unless executing-kbd-macro | 747 | (unless executing-kbd-macro |
| 748 | (end-kbd-macro arg #'kmacro-loop-setup-function) | 748 | (end-kbd-macro arg #'kmacro-loop-setup-function) |
| 749 | (when (and last-kbd-macro (= (length last-kbd-macro) 0)) | 749 | (when (and last-kbd-macro (= (length last-kbd-macro) 0)) |
| @@ -880,35 +880,25 @@ With \\[universal-argument], call second macro in macro ring." | |||
| 880 | 880 | ||
| 881 | 881 | ||
| 882 | ;;;###autoload | 882 | ;;;###autoload |
| 883 | (defun kmacro-end-and-call-macro (arg &optional no-repeat) | 883 | (defun kmacro-end-and-call-macro (arg &optional no-repeat event) |
| 884 | "Call last keyboard macro, ending it first if currently being defined. | 884 | "Call last keyboard macro, ending it first if currently being defined. |
| 885 | With numeric prefix ARG, repeat macro that many times. | 885 | With numeric prefix ARG, repeat macro that many times. |
| 886 | Zero argument means repeat until there is an error. | 886 | Zero argument means repeat until there is an error. |
| 887 | If triggered via a mouse EVENT, moves point to the position clicked | ||
| 888 | with the mouse before calling the macro. | ||
| 887 | 889 | ||
| 888 | To give a macro a name, so you can call it even after defining other | 890 | To give a macro a name, so you can call it even after defining other |
| 889 | macros, use \\[kmacro-name-last-macro]." | 891 | macros, use \\[kmacro-name-last-macro]." |
| 890 | (interactive "p") | 892 | (interactive (list current-prefix-arg nil |
| 893 | (if (consp last-input-event) last-input-event))) | ||
| 891 | (if defining-kbd-macro | 894 | (if defining-kbd-macro |
| 892 | (kmacro-end-macro nil)) | 895 | (kmacro-end-macro nil)) |
| 896 | (if event (mouse-set-point event)) | ||
| 893 | (kmacro-call-macro arg no-repeat)) | 897 | (kmacro-call-macro arg no-repeat)) |
| 894 | 898 | ||
| 895 | |||
| 896 | ;;;###autoload | 899 | ;;;###autoload |
| 897 | (defun kmacro-end-call-mouse (event) | 900 | (define-obsolete-function-alias 'kmacro-end-call-mouse |
| 898 | "Move point to the position clicked with the mouse and call last kbd macro. | 901 | #'kmacro-end-and-call-macro "31.1") |
| 899 | If kbd macro currently being defined end it before activating it." | ||
| 900 | (interactive "e") | ||
| 901 | (when defining-kbd-macro | ||
| 902 | (end-kbd-macro) | ||
| 903 | (when (and last-kbd-macro (= (length last-kbd-macro) 0)) | ||
| 904 | (setq last-kbd-macro nil) | ||
| 905 | (message "Ignore empty macro") | ||
| 906 | ;; Don't call `kmacro-ring-empty-p' to avoid its messages. | ||
| 907 | (while (and (null last-kbd-macro) kmacro-ring) | ||
| 908 | (kmacro-pop-ring1)))) | ||
| 909 | (mouse-set-point event) | ||
| 910 | (kmacro-call-macro nil t)) | ||
| 911 | |||
| 912 | 902 | ||
| 913 | ;;; Misc. commands | 903 | ;;; Misc. commands |
| 914 | 904 | ||