Subject: Re: bug#58799: Make winner key sequences repeatable in repeat-mode

From: Damien Cassou <[email-masked]>
Date: Sun, 30 Oct 2022 07:39:21 +0100

Hi Stefan,

Stefan Kangas <[email-masked]> writes:
> Damien Cassou <[email-masked]> writes:
>> * lisp/winner.el (winner-repeat-map): New variable.
>> (winner-undo): Put 'repeat-map' property with 'winner-repeat-map'.
>> (winner-redo): Put 'repeat-map' property with 'winner-repeat-map'.
>
> There is no need to repeat the same text twice, so you can delete the
> first occurrence.

Indeed, fixed.

>> +(defvar-keymap winner-repeat-map
>> +  :doc "Keymap to repeat winner key sequences.  Used in `repeat-mode'."
>> +  [left] #'winner-undo
>> +  [right] #'winner-redo)
>
> It should be "<right>" and "<left>" here, I think.

Fixed.

Thank you very much for your reviews.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
>From f23ee8ce89bf6e60d97d738f61e4663fd1e2b3dc Mon Sep 17 00:00:00 2001
From: Damien Cassou <[email-masked]>
Date: Wed, 26 Oct 2022 16:53:23 +0200
Subject: [PATCH] Make winner key sequences repeatable in repeat-mode

* lisp/winner.el (winner-repeat-map): New variable.
(winner-undo):
(winner-redo): Put 'repeat-map' property with 'winner-repeat-map'.
---
 lisp/winner.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/winner.el b/lisp/winner.el
index 174b698e7b..d2040c7e5d 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -328,6 +328,14 @@ winner-mode-map
     map)
   "Keymap for Winner mode.")
 
+(defvar-keymap winner-repeat-map
+  :doc "Keymap to repeat winner key sequences.  Used in `repeat-mode'."
+  "<left>" #'winner-undo
+  "<right>" #'winner-redo)
+
+(put #'winner-undo 'repeat-map 'winner-repeat-map)
+(put #'winner-redo 'repeat-map 'winner-repeat-map)
+
 
 ;;;###autoload
 (define-minor-mode winner-mode
-- 
2.36.2