[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Repeat lambda

From: Juri Linkov
Subject: Re: Repeat lambda
Date: Mon, 12 Apr 2021 19:32:20 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> I see that You bind `C-x u` as a repeat command, but in my case I have
> undo-only. The repeat transient map still uses the normal undo BUT maybe
> there is a "simple" method (in the user config of course) to make u u u
> use the undo-only and (as a plus) make r r r to do undo-redo?
> I suppose that this only needs some define-key like below?

Maybe something like this:

#+begin_src emacs-lisp
(defvar undo-redo-repeat-map
  (let ((map (make-sparse-keymap)))
    (define-key map "u" 'undo-only)
    (define-key map "r" 'undo-redo)
  "Keymap to repeat undo-redo key sequences.  Used in `repeat-mode'.")
(put 'undo-only 'repeat-map 'undo-redo-repeat-map)
(put 'undo-redo 'repeat-map 'undo-redo-repeat-map)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]