bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59305: 29.0.50; keymap-global-set handling of string bindings differ


From: Stefan Kangas
Subject: bug#59305: 29.0.50; keymap-global-set handling of string bindings different from global-set-key
Date: Thu, 24 Nov 2022 16:14:05 -0800

Robert Pluim <rpluim@gmail.com> writes:

> After reading up on `key-valid-p':
>
> 5. (keymap-global-set "C-c h" "h e l l o") => success!
>
> or alternatively
>
> 6. (keymap-global-set "C-c h" [?h ?e ?l ?l ?o]) => success!
>
> Whilst not strictly a regression, this behaviour is confusing and
> unhelpful, and the solution is not easily found. I can think of two
> solutions:
>
> 1. Change `kbd' to always return a vector even if the input is
> ascii-only, which makes [4] work
> 2. Change `keymap-set' to convert ascii-only strings to the format in
> [5] or [6]. Probably just a call to `string-to-vector' is enough.

I feel like the second alternative goes against the design of
`keymap-global-set', where the idea explicitly was to only support a KEY
argument that is `key-valid-p'.

Could we perhaps introduce a new optional argument to treat the argument
as a literal string?  Or if really want it to not be `key-valid-p', to
at least require it to be something like '(literal "foo") ?

It would be useful to here what Lars thinks (in Cc).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]