From 618e61f6a990e3137df838a3ba4b25efcfc29927 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 10 Jun 2025 09:34:28 +0300 Subject: [PATCH] * test/lisp/repeat-tests.el: Add a command to continue but not activate. (repeat-tests-call-e): New command. (repeat-tests-global-map): Bind it to 'C-M-e'. (repeat-tests-another-repeat-map, repeat-tests-repeat-map): Add 'repeat-tests-call-e' to :continue. (repeat-tests-continue, repeat-tests-continue-another): Add 'C-M-e' that should continue but not activate. (cherry picked from commit 073d06e34e1eca224e33b5b350645b4c4af04244) --- test/lisp/repeat-tests.el | 50 ++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/test/lisp/repeat-tests.el b/test/lisp/repeat-tests.el index bfa838d383b..f96d8df2ebd 100644 --- a/test/lisp/repeat-tests.el +++ b/test/lisp/repeat-tests.el @@ -24,8 +24,10 @@ (require 'ert) (require 'repeat) -;; Key mnemonics: a - Activate (enter, also b, s), c - Continue (also d, t), -;; o - continue-Only (not activate, also u), q - Quit (exit) +;; Key mnemonics: a - activate (enter, also b, s), +;; c - continue (also d, t, also o, u), +;; e - continue-only (not activate), +;; q - quit (exit) (defvar repeat-tests-calls nil) @@ -45,6 +47,10 @@ (interactive "p") (push `(,arg d) repeat-tests-calls)) +(defun repeat-tests-call-e (&optional arg) + (interactive "p") + (push `(,arg e) repeat-tests-calls)) + (defun repeat-tests-call-o (&optional arg) (interactive "p") (push `(,arg o) repeat-tests-calls)) @@ -71,6 +77,7 @@ "C-x w a" 'repeat-tests-call-a "C-M-a" 'repeat-tests-call-a "C-M-b" 'repeat-tests-call-b + "C-M-e" 'repeat-tests-call-e "C-M-o" 'repeat-tests-call-o "C-M-s" 'repeat-tests-call-s "C-M-u" 'repeat-tests-call-u) @@ -78,7 +85,8 @@ (defvar-keymap repeat-tests-another-repeat-map :doc "Keymap for repeating other sequences." :repeat ( :enter (repeat-tests-call-s) - :continue (repeat-tests-call-o + :continue (repeat-tests-call-e + repeat-tests-call-o repeat-tests-call-u)) "s" 'ignore ;; for non-nil repeat-check-key only "t" 'repeat-tests-call-t @@ -88,7 +96,8 @@ (defvar-keymap repeat-tests-repeat-map :doc "Keymap for repeating sequences." :repeat ( :enter (repeat-tests-call-a) - :continue (repeat-tests-call-o) + :continue (repeat-tests-call-e + repeat-tests-call-o) :exit (repeat-tests-call-q)) "a" 'ignore ;; for non-nil repeat-check-key only "c" 'repeat-tests-call-c @@ -206,14 +215,19 @@ (with-repeat-mode repeat-tests-global-map (let ((repeat-echo-function 'ignore) (repeat-check-key nil)) - ;; 'C-M-o' used as continue + ;; 'C-M-e' and 'C-M-o' used as continue (repeat-tests--check - "C-M-a c C-M-o c z" - '((1 a) (1 c) (1 o) (1 c)) "z") - ;; 'C-M-o' should not activate + "C-M-a c C-M-e C-M-o c z" + '((1 a) (1 c) (1 e) (1 o) (1 c)) "z") + ;; 'C-M-e' should not activate (repeat-tests--check - "C-M-o c z" - '((1 o)) "cz")))) + "C-M-e c z" + '((1 e)) "cz") + ;; 'C-M-o' should also activate + ;; (repeat-tests--check + ;; "C-M-o c z" + ;; '((1 o) (1 c)) "z") + ))) (ert-deftest repeat-tests-continue-another () (with-repeat-mode repeat-tests-global-map @@ -223,14 +237,18 @@ (repeat-tests--check "C-M-s t t z" '((1 s) (1 t) (1 t)) "z") - ;; 'C-M-u' used as continue + ;; 'C-M-e' and 'C-M-u' used as continue (repeat-tests--check - "C-M-s t C-M-u t z" - '((1 s) (1 t) (1 u) (1 t)) "z") - ;; 'C-M-u' should not activate + "C-M-s t C-M-e C-M-u t z" + '((1 s) (1 t) (1 e) (1 u) (1 t)) "z") + ;; 'C-M-e' should not activate (repeat-tests--check - "C-M-u t z" - '((1 u)) "tz") + "C-M-e t z" + '((1 e)) "tz") + ;; 'C-M-u' should also activate + ;; (repeat-tests--check + ;; "C-M-u t z" + ;; '((1 u) (1 t)) "z") ;; 'C-M-o' shared with another map should continue current map (repeat-tests--check "C-M-s t C-M-o C-M-o t z" -- 2.39.5