~protesilaos/logos

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
5 2

[PATCH] Add new map for repeat-mode

Details
Message ID
<20220723023421.78709-1-lucy.mcphail.p@gmail.com>
DKIM signature
missing
Download raw message
Patch: +10 -0
---
 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
Details
Message ID
<87v8rok0ki.fsf@protesilaos.com>
In-Reply-To
<20220723023421.78709-1-lucy.mcphail.p@gmail.com> (view parent)
DKIM signature
missing
Download raw message
> 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]

> +(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'.")

Can we use the remap mechanism here?  Like we do in the sample
configuration?

    (define-key map [remap forward-page] #'logos-forward-page-dwim)
    (define-key map [remap backward-page] #'logos-backward-page-dwim)

Not sure if repeat-mode has any special requirement in this regard.

All the best,
Protesilaos (or simply "Prot")

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<m2v8roil1b.fsf@gmail.com>
In-Reply-To
<87v8rok0ki.fsf@protesilaos.com> (view parent)
DKIM signature
missing
Download raw message
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
Details
Message ID
<87sfmsjyuj.fsf@protesilaos.com>
In-Reply-To
<m2v8roil1b.fsf@gmail.com> (view parent)
DKIM signature
missing
Download raw message
> From: Lucy McPhail <lucy.mcphail.p@gmail.com>
> Date: Sat, 23 Jul 2022 04:07:27 +0100
>
>> 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.

Thanks for the explanation!  I expected it to be tricky...

I installed your patch and included your name in the manual's
"Acknowledgements" section.

Since this is a small change, it does not require copyright assignment
to the Free Software Foundation.  Though note that larger changes do
need that (I can send you the application form, if needed).

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<m2o7xfj309.fsf@gmail.com>
In-Reply-To
<87sfmsjyuj.fsf@protesilaos.com> (view parent)
DKIM signature
missing
Download raw message
> Thanks for the explanation!  I expected it to be tricky...

I'm sure it can be done but it seems like overkill, and besides,
everywhere I looked in Emacs it's done the same way. I suppose a user
could just change the map if they wanted to.

> I installed your patch and included your name in the manual's
> "Acknowledgements" section.

Thank you!

> Since this is a small change, it does not require copyright assignment
> to the Free Software Foundation.  Though note that larger changes do
> need that (I can send you the application form, if needed).

It would be great if you could send me the form.

Lucy
Details
Message ID
<87czdvn9u2.fsf@protesilaos.com>
In-Reply-To
<m2o7xfj309.fsf@gmail.com> (view parent)
DKIM signature
missing
Download raw message
> From: Lucy McPhail <lucy.mcphail.p@gmail.com>
> Date: Sat, 23 Jul 2022 15:35:23 +0100
>
>> Thanks for the explanation!  I expected it to be tricky...
>
> I'm sure it can be done but it seems like overkill, and besides,
> everywhere I looked in Emacs it's done the same way. I suppose a user
> could just change the map if they wanted to.

Indeed.  It is not a big deal.  In the worst case scenario, we will get
a bug report to which we wil react accordingly.  No worries!

>> I installed your patch and included your name in the manual's
>> "Acknowledgements" section.
>
> Thank you!

You are welcome and thanks again for the patch!

>> Since this is a small change, it does not require copyright assignment
>> to the Free Software Foundation.  Though note that larger changes do
>> need that (I can send you the application form, if needed).
>
> It would be great if you could send me the form.

I copy it further below.  This covers your contributions to core Emacs
and all packages on GNU ELPA.

PLEASE NOTE: do not send any of this information to me.  If/when you
submit a new patch, all I need is verbal confirmation from your side
that you completed the copyright assignment process.


    Please email the following information to assign@gnu.org, and we
    will send you the assignment form for your past and future changes.

    Please use your full legal name (in ASCII characters) as the subject
    line of the message.

    REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

    [What is the name of the program or package you're contributing to?]

    GNU Emacs

    [Did you copy any files or text written by someone else in these changes?
    Even if that material is free software, we need to know about it.]


    [Do you have an employer who might have a basis to claim to own
    your changes?  Do you attend a school which might make such a claim?]


    [For the copyright registration, what country are you a citizen of?]


    [What year were you born?]


    [Please write your email address here.]


    [Please write your postal address here.]


    [Which files have you changed so far, and which new files have you written
    so far?]


All the best,
Prot

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)