unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* seeking feedback on keymaps introspection tool
@ 2023-05-29 12:54 Psionic K
  2023-05-30 15:04 ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Psionic K @ 2023-05-29 12:54 UTC (permalink / raw)
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]

I am close to publishing a package called user-keys.  The goal was to
assist in diagnosing and planning out bindings schemes.  So far it has
three main functions:

   - Show all shadows for a sequence
   - Show all sequences from a preferred list of sets
   - Show all sequences matching predicates

One possible next goal is to show emulation map updates and listing active
maps with symbols rather than raw keymap data structures.

I am planning to extend the predicate matching to work on mass-unbinding.
Right now it's useful for diagnosing all "stupid" bindings, which I
preconfigured to predicates such as, "modified shift keys" or "multiple
modifiers".

Part of the goal was to develop a transient interface to articulate these
views of the keymaps.  I'm not sure how that's progressing since there's
not quite enough functionality to leverage state and input re-use that
characterizes a good context specific interface.

I felt like it's a good time to show what's built and see if anyone has
ideas based on experience about difficulty getting a good high-level view
of active maps and what information they miss as a developer or user.

I attached screenshots to this issue since I haven't made a video demo yet:
https://github.com/positron-solutions/user-keys/issues/1

Thanks

-- 

Psionic K <psionik@positron.solutions>
Software Engineer

*Positron Solutions <https://github.com/positron-solutions>*

[-- Attachment #2: Type: text/html, Size: 2625 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: seeking feedback on keymaps introspection tool
  2023-05-29 12:54 seeking feedback on keymaps introspection tool Psionic K
@ 2023-05-30 15:04 ` Ihor Radchenko
       [not found]   ` <CADQMGASVrHjwd_gKQDXRtL4e9_SdD3AZBSDDuTX7fNCp8sVuUQ@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2023-05-30 15:04 UTC (permalink / raw)
  To: Psionic K; +Cc: Emacs developers

Psionic K <psionik@positron.solutions> writes:

> I am planning to extend the predicate matching to work on mass-unbinding.
> Right now it's useful for diagnosing all "stupid" bindings, which I
> preconfigured to predicates such as, "modified shift keys" or "multiple
> modifiers".

You are assuming that everybody is using QWERTY and US keyboard layout,
aren't you?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: seeking feedback on keymaps introspection tool
       [not found]     ` <87353coojd.fsf@localhost>
@ 2023-06-01 12:18       ` Psionic K
  0 siblings, 0 replies; 3+ messages in thread
From: Psionic K @ 2023-06-01 12:18 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 3139 bytes --]

I finished a rough proof-of-concept for abstract commands on top of command
remapping.  I used a macro to generate a mass rebind expression.  I can
still use C-n and C-p.  I can rebind the abstract commands and all of the
other commands follow.  If I add bindings to #'abstract-next to C-; for
example, all of the re-mapped commands are available on that sequence and
shadow appropriately.

Pretty print the macro at the bottom of the user-keys-abstract package see
a mass rebranding expression:
https://github.com/positron-solutions/user-keys/blob/master/lisp/user-keys-abstract.el

The tests also demonstrate the outputs, but are less realistic.

I am currently using Emacs with all of the mentioned keys rebound by the
macro call.  The first example of growing pains I found is that Ivy
actually already uses a remap to next-line.  Since it wasn't a built-in
Emacs map, I didn't include it in my example macro.  I would have to work
on the macro and expression generation to handle remap detection when
performing a move, but this is more a matter of plumbing than complexity.

I was able to use my reporting functionality from the user-keys package to
identify maps to start working on.  The commented expressions in the macro
caused errors (binding in the widget-global-map affects the global-map?) or
strange behavior I don't want to invest time in before validating the use
cases.

What I would recommend for Emacs is to implement a first-class named-key
that doesn't have the implementation limitations of the remap only going
through one layer.  I would be able to focus on making user-keys into a
better diagnosis and generation tool if I avoid going too deep on top of
the remap-based implementation, which has the one-indirection depth
limitation.

I'll publish the package pretty soon with some small coherence
improvements.  While looking at emulation maps, I realized some of them
won't have symbols for example, so I need to figure out a way to represent
the idea to the user.  I've worked a bit on generating mass unbinds by
refactoring the reporting logic and it generally looks like there won't be
difficulty.

On Wed, May 31, 2023 at 4:05 AM Ihor Radchenko <yantar92@posteo.net> wrote:

> Psionic K <psionik@positron.solutions> writes:
>
> >
> https://github.com/positron-solutions/user-keys/blob/master/lisp/user-keys.el#L142-L147
>
> Nice.
>
> Another idea: some key bindings are risky when using Emacs from
> terminals. For example, bindings like M-<RET> often do not work in
> terminals. It would be nice to provide some hints about which keys may
> not work in terminals, at least approximately (doing this precisely
> depends on terminal being used and is generally not easy).
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 

Psionic K <psionik@positron.solutions>
Software Engineer

*Positron Solutions <https://github.com/positron-solutions>*

[-- Attachment #2: Type: text/html, Size: 4918 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-01 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-29 12:54 seeking feedback on keymaps introspection tool Psionic K
2023-05-30 15:04 ` Ihor Radchenko
     [not found]   ` <CADQMGASVrHjwd_gKQDXRtL4e9_SdD3AZBSDDuTX7fNCp8sVuUQ@mail.gmail.com>
     [not found]     ` <87353coojd.fsf@localhost>
2023-06-01 12:18       ` Psionic K

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