all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Alexander Prähauser" <ahprae@protonmail.com>
Cc: 70596@debbugs.gnu.org
Subject: bug#70596: 30.0.50; key-translate returns error for key sequences with punctuation marks
Date: Sat, 27 Apr 2024 22:51:33 -0400	[thread overview]
Message-ID: <jwvv842jjf2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <875xw4m3si.fsf@protonmail.com> ("Alexander Prähauser"'s message of "Fri, 26 Apr 2024 17:29:35 +0000")

> (key-translate "C-." "C-a")

`key-translate` works by modifying `keyboard-translate-table` which is
a table remapping *characters* and not *keys*.

IOW, `key-translate` is a misnomer.

> Ah, I see.  Then I guess you can close this report.  So is there no way
> to translate `C-.` into `C-g`?

There are different ways to "translate" keys, and they all work slightly
differently.  If you expect to be able to hit `C-.` (instead of `C-g`)
to interrupt a running command, then that's more delicate to do
(because such interruptions use a mechanism that doesn't go through
keymaps like normal commands do), but otherwise something like

    (define-key input-decode-map (kbd "C-.") (kbd "C-g"))

might do the trick.


        Stefan






  parent reply	other threads:[~2024-04-28  2:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 17:29 bug#70596: 30.0.50; key-translate returns error for key sequences with punctuation marks Alexander Prähauser via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-26 18:28 ` Eli Zaretskii
2024-04-27  9:24   ` Alexander Prähauser via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-27 10:12     ` Eli Zaretskii
2024-04-27 10:47       ` Alexander Prähauser via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-27 11:46         ` Eli Zaretskii
2024-04-28  2:51 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-05-02  9:21   ` 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=jwvv842jjf2.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=70596@debbugs.gnu.org \
    --cc=ahprae@protonmail.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.