|
From: | Juri Linkov |
Subject: | Re: master 12409c9: New transient mode 'repeat-mode' to allow shorter key sequences (bug#46515) |
Date: | Thu, 18 Feb 2021 19:29:10 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
>>>> +(defvar next-error-repeat-map >>>> + (let ((map (make-sparse-keymap))) >>>> + (define-key map "n" 'next-error) >>>> + (define-key map "\M-n" 'next-error) >>>> + (define-key map "p" 'previous-error) >>>> + (define-key map "\M-p" 'previous-error) >>>> + map) >>>> + "Keymap to repeat next-error key sequences. Used in `repeat-mode'.") >>>> +(put 'next-error 'repeat-map 'next-error-repeat-map) >>>> +(put 'previous-error 'repeat-map 'next-error-repeat-map) >>> >>> Could we avoid this duplication between the map and the >>> `repeat-map` property? > > There is in the above code snippet: the `put` statements are redundant > since the same info is fundamentally already available from > `next-error-repeat-map`. Now I see where is duplication. But currently I have no idea in what keymaps post-command-hook should look for keybindings. When a command is associated with a keymap `next-error-repeat-map` via `put` property, then post-command-hook knows where to look for keybindings for the current command (using `this-command`).
[Prev in Thread] | Current Thread | [Next in Thread] |