From: Juri Linkov <juri@linkov.net>
To: Paul Nelson <ultrono@gmail.com>
Cc: 74140@debbugs.gnu.org
Subject: bug#74140: [PATCH] Add :continue-only directive for repeat maps in bind-keys, use-package
Date: Thu, 07 Nov 2024 21:41:07 +0200 [thread overview]
Message-ID: <875xoyu90s.fsf@mail.linkov.net> (raw)
In-Reply-To: <CAOA-32NZHhedgVswNHULGewUERFUgNxR_Z8iOf1nvH7wastcbQ@mail.gmail.com> (Paul Nelson's message of "Tue, 5 Nov 2024 21:51:11 +0100")
>> Keys are required as well to be able to decide whether
>> to activate the repeat-map.
>
> I still don't follow. Couldn't we somehow keep track of the active
> repeat-map (or really, its underlying symbol) and check whether that
> lies in the provided list? Why should it be necessary to keep track
> of the key that activated it? In any event, we don't know in advance
> whether the specific key is the same or different across the keymaps
> that we do or do not want the command to participate in, so I don't
> see how knowing the key could be a useful differentiating factor.
Keys will help to avoid aliases. In your example:
:continue-only
;; These commands will be available during paragraph manipulation
;; but won't activate paragraph-repeat-map themselves
("y" . yank)
("C-/" . undo))
to be able to not activate repeat-map on executing the command 'yank'
with the global keybinding such as 'C-y', we can check
that last-command-event is 'y'.
Or do you think it would help to take into account the fact
that the current repeat-map is already activated? But still
in this case I don't see how it's possible to avoid checking the key.
>> There are two possible ways to do this: opt-in and out-out.
>>
>> 1. opt-in defines all global keys that activate a repeat-map. e.g.:
>>
>> (put 'undo 'repeat-entry-keys '((paragraph-repeat-map . "C-x u")))
>>
>> 2. out-out defines only keys from the repeat-map that should not activate it
>> by a global key such as the global "u" ('self-insert-command')
>> should not activate paragraph-repeat-map:
>>
>> (put 'undo 'repeat-no-entry-keys '((paragraph-repeat-map . "u")))
>
> What do you have in mind if the user updates the binds in the keymaps?
After any updates the user needs to update symbol properties as well.
prev parent reply other threads:[~2024-11-07 19:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 17:36 bug#74140: [PATCH] Add :continue-only directive for repeat maps in bind-keys, use-package Paul Nelson
2024-11-01 7:54 ` Juri Linkov
2024-11-01 8:29 ` Paul Nelson
2024-11-01 8:58 ` Paul Nelson
2024-11-04 19:22 ` Juri Linkov
2024-11-04 20:45 ` Paul Nelson
2024-11-05 18:25 ` Juri Linkov
2024-11-05 20:51 ` Paul Nelson
2024-11-07 19:41 ` Juri Linkov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875xoyu90s.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=74140@debbugs.gnu.org \
--cc=ultrono@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.