Subject: Re: bug#61548: 30.0.50; Command 'keymap-global-set' fails when called interactively

From: Eli Zaretskii <[email-masked]>
Date: Thu, 16 Feb 2023 10:42:21 +0200

> From: [email-masked]
> Date: Thu, 16 Feb 2023 00:37:58 -0500
> 
> Calling 'keymap-global-set' interactively fails with the message
> 
>   keymap--check: INPUT is not a valid key definition; see ‘key-valid-p’
> 
> where INPUT is the printed representation of the key sequence entered,
> unless that sequence is a single unmodified key. And even among those, I
> only know alphanumeric keys to be exempt; <f6>, <Scroll_Lock> and
> anything you have to put in <brackets> will cause trouble.
> 
> >From 'emacs -Q', simply type
> 
>   M-x keymap-global-set RET

You mean, you get the error after typing "M-x keymap-global-set RET"?
If so, I cannot reproduce this with today's master.  I did:

  emacs -Q
  M-x keymap-global-set RET
  C-x g
  goto-char RET

(where "C-x g" is a key sequence, i.e. press Ctrl and x, then press g)
and didn't see any errors.

> The problem is that the output from 'read-key-sequence', which is called
> by 'keymap-global-set', is not filtered through 'key-description' before
> being assigned to KEY:
> 
>   (interactive
>    (let* ((menu-prompting nil)
>           (key (read-key-sequence "Set key globally: " nil t))) ; error
>      (list key
>            (read-command (format "Set key %s to command: "
>                                  (key-description key))))))

This code is not in the current function on the master branch.  Are
you sure your sources are up to date?