Subject: bug#60101: 29.0.60; help-quick should use C-/ for undo

From: Juri Linkov <[email-masked]>
Date: Sat, 17 Dec 2022 19:16:06 +0200

>> In lisp/bindings.el its preferred binding is defined by this line:
>>
>>   (put 'undo :advertised-binding [?\C-x ?u])
>
> That is good, but it only solves the problem by providing the means.
> The other issue is figuring out how the advertised binding can
> automatically be set to whatever is preferred on the current system.  Is
> there a way to find out what keyboard layout is being used, or at least
> what modifiers have to be pressed for a key to be input?

If a key would be unbound on a tty, this could help to exclude it
from the preferred keybindings.  For example, if C-/ was unbound
depending on a tty type, then this would fall back to 'C-x u':

  (put 'undo :advertised-binding '([?\C-/] [?\C-x ?u]))

But otherwise, could you formulate a clear criteria for excluding
some keys from the set of preferred keys?  Do you know how to
query the current keyboard layout, or to find the preferred modifiers?