emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delegating user-reserved key binding space definition to users


From: Stefan Monnier
Subject: Re: Delegating user-reserved key binding space definition to users
Date: Mon, 28 Nov 2022 23:01:49 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]