unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Psionic K <psionik@positron.solutions>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: seeking feedback on keymaps introspection tool
Date: Thu, 1 Jun 2023 07:18:34 -0500	[thread overview]
Message-ID: <CADQMGASivy8NOyXzTKKpT7=i9cZxjwKMHNp-dEcgYZFjApuTxg@mail.gmail.com> (raw)
In-Reply-To: <87353coojd.fsf@localhost>

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

      parent reply	other threads:[~2023-06-01 12:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [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

  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='CADQMGASivy8NOyXzTKKpT7=i9cZxjwKMHNp-dEcgYZFjApuTxg@mail.gmail.com' \
    --to=psionik@positron.solutions \
    --cc=emacs-devel@gnu.org \
    --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).