Subject: bug#29141: 25.3; Precise if read-key of prefix key is active

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 18 May 2022 00:12:27 +0200

Pierre-Yves Luyten <[email-masked]> writes:

> Expected behavior
> Since the user needs to learn the core of Emacs, it is necessary to be
> able to present to the user, not only available shortuts, but also the
> name of the current keymap
>
> Behavior
> As far as i know, there is no way to say if a prefix key is active.
> One could parse which shortcuts are active, then deduce which prefix key
> is active, but this would not be very reliable.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I'm not sure I understand what is being requested here.  For instance:

(key-binding "\C-c")
=> (keymap (keymap (67108896 . erc-track-switch-buffer) (0 . erc-track-switch-buffer)) mode-specific-command-prefix)

If a key sequence is a prefix key, key-binding will return a keymap, so
you can check that.

As for "the name of the current keymap" -- I'm not sure I understand
that, either.  current-local-map will return that, but perhaps something
else is means?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no