From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Psionic K <psionik@positron.solutions>
Cc: Ihor Radchenko <yantar92@posteo.net>,
Emacs developers <emacs-devel@gnu.org>
Subject: Re: Delegating user-reserved key binding space definition to users
Date: Mon, 28 Nov 2022 23:01:49 -0500 [thread overview]
Message-ID: <jwvfse2e8wr.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CADQMGATy4j_uPg9MBDLWRJNYk4wqn8Mw349pqsgJZeEp7h+c+A@mail.gmail.com> (Psionic K.'s message of "Mon, 28 Nov 2022 20:38:47 -0600")
>> a solution should allow packages to declare that command FOO
>> should be bound to some key based on SOME-INFO, such that it will be
>> bound to one key in "normal Emacs mode", and to another in `evil-mode`
>> and to yet another in `god-mode`, etc...
>
> SOME-INFO will be of the form:
> ((concept command) (concept command) ...)) ; package provide
> ((concept (concept concept concept)) (concept concept)) ; overload
> remappings, perhaps user or package provided or both
> ((concept binding) (concept binding)) ; user or emulation mode etc provided
I'm afraid I don't know what this means. Can you try and make it more
concrete with an example?
Note that in the text I wrote, SOME-INFO was supposed to be a piece of
information specific to the command FOO. I get the impression that your
SOME-INFO includes info for several commands. Maybe we'll have to do
that, but I was hoping we could avoid it.
> In the beginning, before packages provide their half, the user will provide
> it, likely through a package. This is analogous to evil collection.
I don't want SOME-INFO to explicitly say what should happen for
`evil-mode`, vanilla Emacs mode, `god-mode`, `boon-mode`,
`ergoemacs-mode`, modalka, ...
This is the mess we already have.
Instead SOME-INFO should give just enough data to those modes such that
they can wisely (and predictably) choose a binding for that command.
>> To me a solution should allow packages to declare that command FOO
>> should be bound to some key based on SOME-INFO, such that it will be
>> bound to one key in "normal Emacs mode", and to another in `evil-mode`
>> and to yet another in `god-mode`, etc...
>
> This places too much emphasis on package authors.
I hope with my above explanation you can agree that it also gives a lot
of power to the keybinding styles. And of course, ultimately the
end-user can override any of those decisions (this is Emacs we're
talking about, after all).
> As stated above, I believe it's the job of modal systems to
> decide how to consume the package-defined half of SOME-INFO.
IIUC we violently agree.
I personally don't yet have a clear idea of what SOME-INFO may look
like. I suspect it could include some letters (used as hints to help
the keybinding-style choose keys) plus a set of "features" maybe (like
forward/up/down/backward for direction, or add/remove, or
char/word/symbol/sexp/buffer for granularity/subject). It should likely
include also some notion of scope (global, buffer-local, local to
a region, specific to some particular set of major mode, only
meaningful when the region is active, ...).
Stefan
next prev parent reply other threads:[~2022-11-29 4:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 14:40 Delegating user-reserved key binding space definition to users Psionic K
2022-11-21 19:37 ` Stefan Monnier
2022-11-22 2:07 ` Phil Sainty
2022-11-25 2:48 ` Psionic K
2022-11-25 3:31 ` Ihor Radchenko
2022-11-25 13:53 ` xenodasein--- via Emacs development discussions.
2022-11-25 15:16 ` Stefan Monnier
2022-11-26 6:44 ` Ihor Radchenko
2022-11-26 17:29 ` Stefan Monnier
2022-11-27 5:45 ` Ihor Radchenko
2022-11-27 11:26 ` Psionic K
2022-11-27 11:53 ` Psionic K
2022-11-28 18:15 ` Stefan Monnier
2022-11-28 18:37 ` Eli Zaretskii
2022-11-29 2:38 ` Psionic K
2022-11-29 4:01 ` Stefan Monnier [this message]
2022-11-29 5:22 ` Psionic K
2022-11-29 13:03 ` Eli Zaretskii
2022-11-30 6:23 ` Psionic K
2022-11-30 9:01 ` xenodasein--- via Emacs development discussions.
2022-11-30 13:44 ` Eli Zaretskii
2022-11-29 11:54 ` John Yates
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvfse2e8wr.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=psionik@positron.solutions \
--cc=yantar92@posteo.net \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).