GNU bug report logs - #72460
[patch] add commands for setting keyboard translations interactively

Previous Next

Package: emacs;

Reported by: hugo <at> heagren.com

Date: Sun, 4 Aug 2024 12:18:02 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 72460 <at> debbugs.gnu.org (full text, mbox):

From: hugo <at> heagren.com
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72460 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#72460: [patch] add commands for setting keyboard translations
 interactively
Date: Sat, 28 Sep 2024 16:33:09 +0100
[Message part 1 (text/plain, inline)]
Hi all,

sorry, I was working on this last night , had the patch sorted, and
then somehow my browser crashed and I couldn't get to my email.
Apologies for all the delays.

> Rewriting a whole new `key-translate-selection-function` function for
> that is not significantly easier than rewriting a whole new
> `key-translate-remove`, so I think this is firmly in the 
> overengineering
> side of the camp.

Fair enough, I've got rid of the defcustom.

> You can't trust `get-text-property` here (especially since you don't
> even force `completing-read` to `require-match`).
> Instead you should do something like `key-parse`.

Good spot.

> In the case of `key-translate-remove` I don't expect the arg to be
> a literal constant in the code, so "nice/uniform syntax to write the
> argument value" shouldn't be a concern.  🙂

Nice, removing the defcustom makes the whole thing simpler anyway.

The way it works now is that `key-select-translation' returns a string
(which passes `key-valid-p'). I went with this because then it's very
straightforward to pass the result to `key-translate' in
`key-translate-remove'. The alternative would be to parse a key vector
out of the string at the end of `key-select-translation', but then
immediately convert this back into a string (a string like the one I
went with in the end) in the interactive form of `key-translate-remove'.

New patch attached.

Hugo
[0001-Add-commands-to-interactively-set-unset-keyboard-tra.patch (text/x-diff, attachment)]

This bug report was last modified 232 days ago.

Previous Next


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