Subject: bug#74903: [PATCH] Add function to show table of keys when describing keymap variable

From: Mekeor Melire <[email-masked]>
Date: Tue, 24 Dec 2024 23:14:31 +0000

Resending an email that I mistakenly had only sent to Stefan 
Monnier:

On Mon, 16 Dec 2024 22:03:22 -0500, Stefan Monnier 
<[email-masked]> said: 
 
> The table is a bit redundant with the s-exp representation and 
> I'm not sure we want to spend all this time&space printing out a 
> large keymap, but maybe we could use the 
> `help-fns-describe-variable-functions` mechanism to add a 
> one-liner that can be clicked to get to the keymap-specific 
> description, a bit like Custom vars have a "You can customize 
> this variable" link.  WDYT? 
 
I agree that there's redundancy.  But since adding the function 
`help-fns-keymap-key-bindings' from my patch to 
`help-fns-describe-variable-functions` would be opt-in, it'd be up 
to the user to decide between redundancy and convenience. 
Nevertheless, I like your idea of a clickable button, e.g. worded 
"View this keymap as a table" in the *Help* buffer.  Let me 
continue your comparison to the "You can customize this variable" 
button by noting that its command, `help-customize', is also bound 
to "c" in Help-Mode.  I'd also like a key binding for "View this 
keymap as a table", e.g. "k".  So, these key sequences would 
result in the same state:

    C-h v foo-map RET k
    M-x describe-keymap foo-map RET

But we can build up this idea further: What if these would also 
result in the same state? (`ido-mode' is both a variable and a 
function.)

    C-h f ido-mode RET o
    C-h v ido-mode RET o
    C-h o ido-mode RET

And also:

    C-h v ido-mode RET f
    C-h f ido-mode RET

What do you think about enabling users to easily "effectively switch"
between describe-* commands in this way?