Subject: Re: bug#70596: 30.0.50; key-translate returns error for key sequences with punctuation marks
From: Eli Zaretskii <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Thu, 02 May 2024 12:21:20 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Cc: [email-masked]
> Date: Sat, 27 Apr 2024 22:51:33 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> > (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.

Thanks.  The ELisp manual already hinted on this; I've now added some
more explicit motivation, and I'm therefore closing this bug.