unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#29141: 25.3; Precise if read-key of prefix key is active
@ 2017-11-03 22:30 Pierre-Yves Luyten
  2022-05-17 22:12 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre-Yves Luyten @ 2017-11-03 22:30 UTC (permalink / raw)
  To: 29141

Hello

Context
i am working on convenience packages to help the user with available 
shortcuts. One thing i am using is "which-key". This package allows
to display visualy the existing shortcuts for a given prefix key.
Actually it might work for any keymap, so it is an efficient way
for the user to discover a keymap.

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.

Enhancement Request
So, is it possible to add a func to tell if there is a prefix key?
obviously i think the func might be more general, for example checking 
if there is a read-key active, else a terminal keymap, else a minor mode 
overriding map, and so on from highest to lowest priority, and checking 
if a prefix key is active -> leading to another keymap being active.
I confess i have no clue about "virtual" keymaps like "C-c".
This is a prefix key but i think different shortcuts in different keymaps.

The opened bug against which-key is : 
https://github.com/justbur/emacs-which-key/issues/176

Please tell me if this enhancement seems fair to you, in which case
do you have a clue so i can evenutally contribute.

Regards
Pierre-Yves





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#29141: 25.3; Precise if read-key of prefix key is active
  2017-11-03 22:30 bug#29141: 25.3; Precise if read-key of prefix key is active Pierre-Yves Luyten
@ 2022-05-17 22:12 ` Lars Ingebrigtsen
  2022-06-15 12:41   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-17 22:12 UTC (permalink / raw)
  To: Pierre-Yves Luyten; +Cc: 29141

Pierre-Yves Luyten <py@luyten.fr> 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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#29141: 25.3; Precise if read-key of prefix key is active
  2022-05-17 22:12 ` Lars Ingebrigtsen
@ 2022-06-15 12:41   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-15 12:41 UTC (permalink / raw)
  To: Pierre-Yves Luyten; +Cc: 29141

Lars Ingebrigtsen <larsi@gnus.org> writes:

> 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?

More information was requested, but no response was given within a
month, so I'm closing this bug report.  If the problem still exists,
please respond to this email and we'll reopen the bug report.

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-15 12:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03 22:30 bug#29141: 25.3; Precise if read-key of prefix key is active Pierre-Yves Luyten
2022-05-17 22:12 ` Lars Ingebrigtsen
2022-06-15 12:41   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).