From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Charalampos Mitrodimas <charmitro@posteo.net>
Cc: 70139@debbugs.gnu.org
Subject: bug#70139: [PATCH] Improve key-translate to support removing translations
Date: Sun, 07 Apr 2024 10:45:28 -0400 [thread overview]
Message-ID: <jwvle5pz10f.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m2le5ql89m.fsf@posteo.net> (Charalampos Mitrodimas's message of "Sat, 06 Apr 2024 17:18:29 +0000")
> + (lambda (form) (keymap--compile-check from (and to to)) form)))
^^^^^^^^^^^
??
> (keymap--check from)
> - (keymap--check to)
> - (or (char-table-p keyboard-translate-table)
> - (setq keyboard-translate-table
> - (make-char-table 'keyboard-translate-table nil)))
> - (aset keyboard-translate-table
> - (aref (key-parse from) 0)
> - (aref (key-parse to) 0)))
> + (when to
> + (keymap--check to))
> + (let ((from-key (key-parse from))
> + (to-key (and to (key-parse to))))
> + (when (> (length from-key) 1)
> + (error "FROM key %s is not a single key" from))
> + (when (and to (> (length to-key) 1))
> + (error "TO key %s is not a single key" to))
I'd check `=` while at it (if length is 0 the error is caught by
`aref`, but it's a less helpful error).
Stefan
next prev parent reply other threads:[~2024-04-07 14:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 9:50 bug#70139: 29.3.50; key-translate does not support all keyboard-translate usages Robert Pluim
2024-04-02 14:21 ` bug#70139: [PATCH] Improve key-translate to support removing translations Charalampos Mitrodimas
2024-04-02 14:28 ` bug#70139: 29.3.50; key-translate does not support all keyboard-translate usages Charalampos Mitrodimas
2024-04-02 15:41 ` Robert Pluim
2024-04-02 19:02 ` bug#70139: [PATCH] Improve key-translate to support removing translations Charalampos Mitrodimas
2024-04-04 13:00 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-04 19:48 ` Charalampos Mitrodimas
2024-04-04 21:53 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-06 17:09 ` Charalampos Mitrodimas
2024-04-06 17:18 ` Charalampos Mitrodimas
2024-04-07 14:45 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-04-09 11:14 ` Charalampos Mitrodimas
2024-04-09 12:57 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-09 13:07 ` Charalampos Mitrodimas
2024-04-13 9:19 ` Eli Zaretskii
2024-04-13 12:46 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-13 16:02 ` Eli Zaretskii
2024-04-14 21:31 ` Charalampos Mitrodimas
2024-04-15 2:30 ` Eli Zaretskii
2024-05-20 20:39 ` Charalampos Mitrodimas
2024-05-23 13:25 ` Eli Zaretskii
2024-04-04 12:27 ` bug#70139: 29.3.50; key-translate does not support all keyboard-translate usages 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvle5pz10f.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=70139@debbugs.gnu.org \
--cc=charmitro@posteo.net \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).