(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)
(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))
"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)
(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
(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
(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
(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"