GNU bug report logs - #70139
29.3.50; key-translate does not support all keyboard-translate usages

Previous Next

Package: emacs;

Reported by: Robert Pluim <rpluim <at> gmail.com>

Date: Tue, 2 Apr 2024 09:52:04 UTC

Severity: normal

Found in version 29.3.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Charalampos Mitrodimas <charmitro <at> posteo.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 70139 <at> debbugs.gnu.org
Subject: bug#70139: [PATCH] Improve key-translate to support removing translations
Date: Tue,  9 Apr 2024 11:14:34 +0000
[Message part 1 (text/plain, inline)]
On 4/7/24 17:45, Stefan Monnier wrote:
>> +            (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

Updated & attached.

--
Charalampos
[0001-Improve-key-translate-to-support-removing-translatio.patch (text/x-patch, attachment)]

This bug report was last modified 364 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.