From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 59130@debbugs.gnu.org, "João Guerra" <joca.bt@gmail.com>
Subject: bug#59130: Inconsistent behaviour with key-translation-map
Date: Tue, 08 Nov 2022 16:41:59 -0500 [thread overview]
Message-ID: <jwv35atuo0s.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <835yfpxkm7.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 08 Nov 2022 22:21:52 +0200")
>> However, setting
>> (define-key key-translation-map (kbd "<apps>") (kbd "C-x @ h"))
>> and pressing <apps> p will not execute H-p.
>>
>> (C-x @ h adds prefix hyper
>> https://www.gnu.org/software/emacs/manual/html_node/emacs/Modifier-Keys.html)
>>
>> Is this an issue or as expected?
It's expected because the remapping of `C-x @ h` to a hyper prefix is
done with:
(define-key function-key-map [?\C-x ?@ ?h] 'event-apply-hyper-modifier)
and `function-key-map` is applied *before* `key-translation-map` and hence
doesn't apply to the result of `key-translation-map` remapping.
(define-key input-decode-map (kbd "<apps>") (kbd "C-x @ h"))
might work, OTOH, since `input-decode-map` applies before those
other two.
Note that `event-apply-hyper-modifier` has various limitations
(e.g. you can't use `?\C-x ?@ ?h ?\C-x ?@ ?m a` to make a `H-M-a` event)
so even if the above works it may not satisfy all your use cases.
Stefan
next prev parent reply other threads:[~2022-11-08 21:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-08 19:37 bug#59130: Inconsistent behaviour with key-translation-map João Guerra
2022-11-08 20:21 ` Eli Zaretskii
2022-11-08 21:41 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-11-09 17:17 ` João Guerra
2022-11-10 21:15 ` João Guerra
2022-11-11 7:01 ` Eli Zaretskii
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=jwv35atuo0s.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=59130@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=joca.bt@gmail.com \
--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.