Subject: Re: bug#73744: 26.1; Feature: helpful message from global-set-key giving Lisp

From: Eli Zaretskii <[email-masked]>
Date: Fri, 11 Oct 2024 16:05:38 +0300

> Date: Fri, 11 Oct 2024 09:02:10 +0000
> From:  Edward Avis via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> M-x global-set-key
> Enter some key sequence and the command to bind to it.
> For example I entered C-c v and find-file-at-point.
> The following message is printed in the minibuffer and the *Messages*
> buffer:
> 
>     You can run the command 'global-set-key' with M-x gl-se RET
> 
> Which is helpful and all, but I think it would be great also to show
> the Lisp expression you could use to bind that key.  For example
> 
>     To set this key binding in Lisp,
>       (global-set-key (kbd "C-c v") 'find-file-at-point)
> 
> This could go only to *Messages* and not clutter the minibuffer.

You should be able to see the Lisp expression by typing "C-x z".