all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Justin Burkett <justin@burkett.cc>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 71648@debbugs.gnu.org, rpluim@gmail.com, jb@jeremybryant.net
Subject: bug#71648: 30.0.50; Allow which-key to report on translation bindings
Date: Wed, 19 Jun 2024 11:48:01 -0400	[thread overview]
Message-ID: <CAF8XuLijWXq96qHZen+zNGLYJge3gWym3RMByo1LVNRvSZvkyA@mail.gmail.com> (raw)
In-Reply-To: <864j9posjg.fsf@gnu.org>

On Wed, Jun 19, 2024 at 11:34 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Justin Burkett <justin@burkett.cc>
> > Date: Wed, 19 Jun 2024 11:09:36 -0400
> > Cc: Robert Pluim <rpluim@gmail.com>, Jeremy Bryant <jb@jeremybryant.net>, 71648@debbugs.gnu.org
> >
> > The purpose of which-key was to show the commands that are available
> > following an incomplete key sequence. If I understand correctly, these
> > maps don't hold commands and anyway would be processed before
> > which-key "sees" the current incomplete key sequence.
>
> Everything in Emacs is a command.  The specific sequences Robert was
> talking about eventually insert characters, but they are still a
> sequence of key events.  So I'm not sure I understand how you
> distinguish between them and what fundamental differences do you see.
> Would you like to elaborate on how and why do you perceive these to be
> different?
>
> > If I understand correctly, if "C-d x" translates to "C-c x" then
> > which-key I believe would see the sequence "C-c x" and find the
> > bindings following that sequence. I'm not sure how or why we would
> > want to display the information that "C-d x" translates to "C-c x".
>
> I don't think this case is the most important or the most interesting.

The purpose of the example was to show my (mis)understanding of how
these maps work. I was under the impression from the info manual that
translation keymaps map key sequences to other key sequences which are
then mapped to "commands" (which might be just text to insert).
Quoting the info manual:

"When the ‘read-key-sequence’ function reads a key sequence (*note Key
Sequence Input::), it uses “translation keymaps” to translate certain
event sequences into others.  The translation keymaps are
‘input-decode-map’, ‘local-function-key-map’, and ‘key-translation-map’
(in order of priority).

   Translation keymaps have the same structure as other keymaps, but are
used differently: they specify translations to make while reading key
sequences, rather than bindings for complete key sequences.  As each key
sequence is read, it is checked against each translation keymap.  If one
of the translation keymaps binds K to a vector V, then whenever K
appears as a sub-sequence _anywhere_ in a key sequence, that
sub-sequence is replaced with the events in V."

This reads to me like translation keymaps don't yield "commands" they
act at an intermediate level.

In any event, Robert's example was helpful, and I think that
information would be useful to include in which-key.





  reply	other threads:[~2024-06-19 15:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 12:04 bug#71648: 30.0.50; Allow which-key to report on translation bindings Robert Pluim
2024-06-19 13:12 ` Eli Zaretskii
2024-06-19 15:09   ` Justin Burkett
2024-06-19 15:16     ` Robert Pluim
2024-06-19 15:42       ` Justin Burkett
2024-06-19 21:13       ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-19 15:34     ` Eli Zaretskii
2024-06-19 15:48       ` Justin Burkett [this message]
2024-06-20  8:27         ` Robert Pluim
2024-06-20 14:20           ` Justin Burkett
2024-06-20 14:56             ` Robert Pluim
2024-06-20 15:40               ` Justin Burkett
2024-06-24 13:14                 ` Robert Pluim
2024-06-24 13:30                   ` Eli Zaretskii
2024-06-24 17:20                     ` Robert Pluim

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=CAF8XuLijWXq96qHZen+zNGLYJge3gWym3RMByo1LVNRvSZvkyA@mail.gmail.com \
    --to=justin@burkett.cc \
    --cc=71648@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jb@jeremybryant.net \
    --cc=rpluim@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.