From d3a76db88b4357fe1c92f240796ea9b522b97a8e Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 20 Dec 2022 19:22:15 +0200 Subject: * lisp/repeat.el: Fix repeat-keep-prefix to allow customizing it to non-nil. * lisp/repeat.el (repeat-keep-prefix): Add or remove 'repeat-pre-hook' depending on the customized value. (repeat-mode): Add or remove 'repeat-pre-hook' to/from 'pre-command-hook' when 'repeat-keep-prefix' is non-nil. (repeat-pre-hook): New function. (repeat-get-map, repeat-check-map): New function refactored from 'repeat-post-hook'. (repeat-post-hook): Move some code to smaller functions. (describe-repeat-maps): Set outline-regexp without ^L. * test/lisp/repeat-tests.el (repeat-tests-keep-prefix): Uncomment test case that is fixed now in bug#51281 and bug#55986. --- test/lisp/repeat-tests.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'test/lisp/repeat-tests.el') diff --git a/test/lisp/repeat-tests.el b/test/lisp/repeat-tests.el index 1382d003599..06c6f748a2a 100644 --- a/test/lisp/repeat-tests.el +++ b/test/lisp/repeat-tests.el @@ -76,27 +76,27 @@ "C-x w a b a c" '((1 a) (1 b) (1 a)) "c") (repeat-tests--check - "M-C-a b a c" + "C-M-a b a c" '((1 a) (1 b) (1 a)) "c") (repeat-tests--check - "M-C-z b a c" + "C-M-z b a c" '((1 a)) "bac") (unwind-protect (progn (put 'repeat-tests-call-a 'repeat-check-key 'no) (repeat-tests--check - "M-C-z b a c" + "C-M-z b a c" '((1 a) (1 b) (1 a)) "c")) (put 'repeat-tests-call-a 'repeat-check-key nil))) (let ((repeat-check-key nil)) (repeat-tests--check - "M-C-z b a c" + "C-M-z b a c" '((1 a) (1 b) (1 a)) "c") (unwind-protect (progn (put 'repeat-tests-call-a 'repeat-check-key t) (repeat-tests--check - "M-C-z b a c" + "C-M-z b a c" '((1 a)) "bac")) (put 'repeat-tests-call-a 'repeat-check-key nil)))))) @@ -125,15 +125,17 @@ (repeat-tests--check "C-2 C-x w a C-3 c" '((2 a)) "ccc")) - ;; TODO: fix and uncomment - ;; (let ((repeat-keep-prefix t)) - ;; (repeat-tests--check - ;; "C-2 C-x w a b a b c" - ;; '((2 a) (2 b) (2 a) (2 b)) "c") - ;; (repeat-tests--check - ;; "C-2 C-x w a C-1 C-2 b a C-3 C-4 b c" - ;; '((2 a) (12 b) (12 a) (34 b)) "c")) - ))) + ;; Fixed in bug#51281 and bug#55986 + (let ((repeat-keep-prefix t)) + ;; Re-enable to take effect. + (repeat-mode -1) (repeat-mode +1) + (repeat-tests--check + "C-2 C-x w a b a b c" + '((2 a) (2 b) (2 a) (2 b)) "c") + ;; (repeat-tests--check + ;; "C-2 C-x w a C-1 C-2 b a C-3 C-4 b c" + ;; '((2 a) (12 b) (12 a) (34 b)) "c") + )))) ;; TODO: :tags '(:expensive-test) for repeat-exit-timeout -- cgit v1.2.3