all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	66755-done@debbugs.gnu.org,
	StrawberryTea <look@strawberrytea.xyz>
Subject: bug#66755: 30.0.50; how do i lookup a key but also respect key translations?
Date: Wed, 10 Jan 2024 10:00:29 -0800	[thread overview]
Message-ID: <CADwFkm=Udcx0AAhR8SZEVJChbHz6ehYnZ3BpD06wWFwPdgguuw@mail.gmail.com> (raw)
In-Reply-To: <83msw5hmqn.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Oct 2023 10:22:08 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: StrawberryTea <look@strawberrytea.xyz>
>> Date: Wed, 25 Oct 2023 22:57:58 -0500
>>
>>
>> Hello. So I am trying to define a function which obtains the command
>> that would be called if 'corfu-mode' was not enabled:
>>
>> (defun +corfu--get-passthrough-command ()
>>   (keymap-lookup
>>    (thread-last
>>      (current-active-maps t)
>>      (delq corfu-map)
>>      (delq (and (featurep 'evil)
>>                 (evil-get-auxiliary-keymap corfu-map evil-state))))
>>    (key-description (this-command-keys-vector))))
>>
>> But the issue is basically that
>>
>> (keymap-lookup (current-active-maps t)
>>     (key-description (vector 'backspace)))
>>
>> returns nil whereas
>>
>> (keymap-lookup (current-active-maps t) (key-description (vector ?\C-?)))
>>
>> returns 'lispy-delete-backward' which is the command I actually want
>> returned. When I run 'describe-key-briefly' and type <backspace>, I get
>>
>> DEL (translated from <backspace>) runs the command lispy-delete-backward
>>
>> but I don't know how to look up that translation from Elisp. I looked at
>> the code for 'help.el' and found the above description comes from
>> 'read-key-sequence' returning 'C-?' and 'this-single-command-raw-keys'
>> returning '[backspace]' but 'read-key-sequence' is defined in C and I
>> don't know how trigger it's translation logic programmatically from
>> Elisp.
>
> Perhaps Stefan (CC'ed) could help you.
>
> Btw, this kind of questions should be posted to
> help-gnu-emacs@gnu.org, not here.

That sounds like this is not a bug, so I'm closing the bug report.





  parent reply	other threads:[~2024-01-10 18:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26  3:57 bug#66755: 30.0.50; how do i lookup a key but also respect key translations? StrawberryTea
2023-10-26  7:22 ` Eli Zaretskii
2023-10-26 14:31   ` How do i lookup a key but also respect key translations? (was: bug#66755: 30.0.50) Stefan Monnier
2023-10-28 15:12     ` StrawberryTea
2024-01-10 18:00   ` Stefan Kangas [this message]
2024-01-11  3:41 ` bug#66755: 30.0.50; how do i lookup a key but also respect key translations? Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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='CADwFkm=Udcx0AAhR8SZEVJChbHz6ehYnZ3BpD06wWFwPdgguuw@mail.gmail.com' \
    --to=stefankangas@gmail.com \
    --cc=66755-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=look@strawberrytea.xyz \
    --cc=monnier@iro.umontreal.ca \
    /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.