~protesilaos/logos

Add new map for repeat-mode v1 APPLIED

Lucy McPhail: 1
 Add new map for repeat-mode

 1 files changed, 10 insertions(+), 0 deletions(-)
Hi Prot, and you're welcome!
> Can we use the remap mechanism here?
I don't think we can. When either command is called, repeat-mode
activates the keymap so that you can press [ or ] to repeat the command.
If we used the remap mechanism instead, you would have to repeat the
whole sequence, which defeats the purpose of repeat-mode. That said, if
one were to use some other key binding, it wouldn't get in the way, but
you would be able to press [ and ] next anyway to repeat the command.

Lucy
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~protesilaos/logos/patches/34101/mbox | git am -3
Learn more about email & git

[PATCH] Add new map for repeat-mode Export this patch

---
 logos.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/logos.el b/logos.el
index 33b2240..9b17964 100644
--- a/logos.el
+++ b/logos.el
@@ -360,6 +360,16 @@ alternate, thus toggling MODE."
(defvar logos-focus-mode-map (make-sparse-keymap)
  "The keymap of `logos-focus-mode'.")

(defvar logos-repeat-map
  (let ((map (make-sparse-keymap)))
    (define-key map "]" 'logos-forward-page-dwim)
    (define-key map "[" 'logos-backward-page-dwim)
    map)
  "Keymap to repeat logos key sequences.  Used in `repeat-mode'.")

(put #'logos-forward-page-dwim 'repeat-map 'logos-repeat-map)
(put #'logos-backward-page-dwim 'repeat-map 'logos-repeat-map)

(define-minor-mode logos-focus-mode
  "Buffer-local mode for focused editing.
When enabled it sets the buffer-local value of these user
-- 
2.31.0
> From: Lucy McPhail <lucy.mcphail.p@gmail.com>
> Date: Sat, 23 Jul 2022 03:34:21 +0100
Hello Lucy and thanks for the patch!
> [... 12 lines elided]