GNU bug report logs -
#74903
[PATCH] Add function to show table of keys when describing keymap variable
Previous Next
Reported by: Mekeor Melire <mekeor <at> posteo.de>
Date: Sun, 15 Dec 2024 23:15:02 UTC
Severity: normal
Tags: patch
Done: Mekeor Melire <mekeor <at> posteo.de>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 74903 in the body.
You can then email your comments to 74903 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Sun, 15 Dec 2024 23:15:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Mekeor Melire <mekeor <at> posteo.de>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 15 Dec 2024 23:15:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Tags: patch
It'd be nice if users could opt in to have C-h v some-map RET show a
nice table of key bindings for that keymap. I wrote a function that can
be added to help-fns-describe-variable-functions so that this happens.
What do you think?
Alternatively, we can also add a key binding to help-mode so that users
can easily "switch" from describe-variable to describe-keymap, e.g. per
"K":
C-h v message-mode-map RET K
[0001-Add-function-to-show-table-of-keys-when-describing-k.patch (text/patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Mon, 16 Dec 2024 15:58:03 GMT)
Full text and
rfc822 format available.
Message #8 received at 74903 <at> debbugs.gnu.org (full text, mbox):
> From: Mekeor Melire <mekeor <at> posteo.de>
> Date: Sun, 15 Dec 2024 23:14:15 +0000
>
> It'd be nice if users could opt in to have C-h v some-map RET show a
> nice table of key bindings for that keymap. I wrote a function that can
> be added to help-fns-describe-variable-functions so that this happens.
>
> What do you think?
>
> Alternatively, we can also add a key binding to help-mode so that users
> can easily "switch" from describe-variable to describe-keymap, e.g. per
> "K":
>
> C-h v message-mode-map RET K
We have "C-h b" and "C-h m" which show the bindings, albeit not by
keymap. Is that not enough for some reason?
Adding yet another help command related to key bindings needs to be
justified, since we already have at least two with overlapping
functionalities.
What do others think about this?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Mon, 16 Dec 2024 17:31:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 74903 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Mon, 16 Dec 2024 17:57:14 +0200, Eli Zaretskii <eliz <at> gnu.org> said:
>> From: Mekeor Melire <mekeor <at> posteo.de>
>> Date: Sun, 15 Dec 2024 23:14:15 +0000
>>
>> It'd be nice if users could opt in to have C-h v some-map RET show a
>> nice table of key bindings for that keymap. I wrote a function that can
>> be added to help-fns-describe-variable-functions so that this happens.
>>
>> What do you think?
>>
>> Alternatively, we can also add a key binding to help-mode so that users
>> can easily "switch" from describe-variable to describe-keymap, e.g. per
>> "K":
>>
>> C-h v message-mode-map RET K
Eli> We have "C-h b" and "C-h m" which show the bindings, albeit not by
Eli> keymap. Is that not enough for some reason?
"C-h b" shows all the bindings split out by major and minor mode
already. I guess we could add the name of the relevant keymap as well,
but the people who need to know the name of the keymap generally know
enough about Emacs to figure it out (eg via "C-h k").
Eli> Adding yet another help command related to key bindings needs to be
Eli> justified, since we already have at least two with overlapping
Eli> functionalities.
Eli> What do others think about this?
I really donʼt see the need for more functionality here.
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Mon, 16 Dec 2024 18:42:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 74903 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On December 16, 2024 6:28:58 PM GMT+01:00, Robert Pluim <rpluim <at> gmail.com> wrote:
>>>>>> On Mon, 16 Dec 2024 17:57:14 +0200, Eli Zaretskii <eliz <at> gnu.org> said:
>
> >> From: Mekeor Melire <mekeor <at> posteo.de>
> >> Date: Sun, 15 Dec 2024 23:14:15 +0000
> >>
> >> It'd be nice if users could opt in to have C-h v some-map RET show a
> >> nice table of key bindings for that keymap. I wrote a function that can
> >> be added to help-fns-describe-variable-functions so that this happens.
> >>
> >> What do you think?
> >>
> >> Alternatively, we can also add a key binding to help-mode so that users
> >> can easily "switch" from describe-variable to describe-keymap, e.g. per
> >> "K":
> >>
> >> C-h v message-mode-map RET K
>
> Eli> We have "C-h b" and "C-h m" which show the bindings, albeit not by
> Eli> keymap. Is that not enough for some reason?
>
>"C-h b" shows all the bindings split out by major and minor mode
>already. I guess we could add the name of the relevant keymap as well,
>but the people who need to know the name of the keymap generally know
>enough about Emacs to figure it out (eg via "C-h k").
>
> Eli> Adding yet another help command related to key bindings needs to be
> Eli> justified, since we already have at least two with overlapping
> Eli> functionalities.
>
> Eli> What do others think about this?
>
>I really donʼt see the need for more functionality here.
>
>Robert
>--
I get the impression that you talk about M-x describe-keymap RET which does already exist.
That is not what I proposed. What I proposed is two things:
1. Allow users to opt-in to have C-h v foo-keymap RET show a table of key bindings in addition to the formatting as S-expression. This fits well into the existing help-fns mechanism. The patch I submitted implements a prototype.
2. In help-mode, bind a single-char-key like "K" to a command that will allow users to easily switch from describing a variable as variable to describing it as keymap a la describe-keymap.
I proposed (2.) as an alternative to (1.) but my main proposal is (1.). Both approaches have a similar objection though.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Tue, 17 Dec 2024 02:57:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 74903 <at> debbugs.gnu.org (full text, mbox):
>> It'd be nice if users could opt in to have C-h v some-map RET show a
>> nice table of key bindings for that keymap. I wrote a function that can
>> be added to help-fns-describe-variable-functions so that this happens.
>>
>> What do you think?
>>
>> Alternatively, we can also add a key binding to help-mode so that users
>> can easily "switch" from describe-variable to describe-keymap, e.g. per
>> "K":
>>
>> C-h v message-mode-map RET K
>
> We have "C-h b" and "C-h m" which show the bindings, albeit not by
> keymap. Is that not enough for some reason?
It's quite different, since his proposal is about displaying keymap
values held in variables (i.e. not necessarily currently active).
> Adding yet another help command related to key bindings needs to be
> justified, since we already have at least two with overlapping
> functionalities.
AFAICT his proposal does not add any new command (help or other).
What am I missing?
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Tue, 17 Dec 2024 03:04:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 74903 <at> debbugs.gnu.org (full text, mbox):
> 1. Allow users to opt-in to have C-h v foo-keymap RET show a table of key
> bindings in addition to the formatting as S-expression. This fits well into
> the existing help-fns mechanism. The patch I submitted implements
> a prototype.
>
> 2. In help-mode, bind a single-char-key like "K" to a command that will
> allow users to easily switch from describing a variable as variable to
> describing it as keymap a la describe-keymap.
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?
[ There is also something to be said to spice up `describe-keymap` so it
can be used to *modify* a keymap. But that comes with many more
difficulties (the main one being how to save those modifications so
they survive a restart). ]
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Tue, 17 Dec 2024 07:52:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 74903 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Mon, 16 Dec 2024 18:41:19 +0000, Mekeor Melire <mekeor <at> posteo.de> said:
Mekeor> I get the impression that you talk about M-x describe-keymap RET which does already exist.
No, Iʼm talking about `describe-bindings'.
Mekeor> That is not what I proposed. What I proposed is two things:
Mekeor> 1. Allow users to opt-in to have C-h v foo-keymap RET show a table of
Mekeor> key bindings in addition to the formatting as S-expression. This fits
Mekeor> well into the existing help-fns mechanism. The patch I submitted
Mekeor> implements a prototype.
Again, I donʼt see a need for it. A user trying to figure out
keybindings is not going to be inspecting keymap variables, and
`describe-bindings' or `describe-mode' tells them what they need to
know. A developer writing code presumably knows about keymaps, and
doesnʼt need a different visual representation of them to get stuff
done.
Mekeor> 2. In help-mode, bind a single-char-key like "K" to a
Mekeor> command that will allow users to easily switch from
Mekeor> describing a variable as variable to describing it as
Mekeor> keymap a la describe-keymap.
See my previous paragraph.
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Tue, 17 Dec 2024 08:09:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 74903 <at> debbugs.gnu.org (full text, mbox):
> Mekeor> 1. Allow users to opt-in to have C-h v foo-keymap RET show a table of
> Mekeor> key bindings in addition to the formatting as S-expression. This fits
> Mekeor> well into the existing help-fns mechanism. The patch I submitted
> Mekeor> implements a prototype.
>
> Again, I donʼt see a need for it. A user trying to figure out
> keybindings is not going to be inspecting keymap variables, and
> `describe-bindings' or `describe-mode' tells them what they need to
> know. A developer writing code presumably knows about keymaps, and
> doesnʼt need a different visual representation of them to get stuff
> done.
It would be nice if users will be able first to see keymap tables
in the output of `describe-repeat-maps', then click on a map
variable, and see the same keymap table individually.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Tue, 17 Dec 2024 08:34:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 74903 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Tue, 17 Dec 2024 09:59:57 +0200, Juri Linkov <juri <at> linkov.net> said:
Mekeor> 1. Allow users to opt-in to have C-h v foo-keymap RET show a table of
Mekeor> key bindings in addition to the formatting as S-expression. This fits
Mekeor> well into the existing help-fns mechanism. The patch I submitted
Mekeor> implements a prototype.
>>
>> Again, I donʼt see a need for it. A user trying to figure out
>> keybindings is not going to be inspecting keymap variables, and
>> `describe-bindings' or `describe-mode' tells them what they need to
>> know. A developer writing code presumably knows about keymaps, and
>> doesnʼt need a different visual representation of them to get stuff
>> done.
Juri> It would be nice if users will be able first to see keymap tables
Juri> in the output of `describe-repeat-maps', then click on a map
Juri> variable, and see the same keymap table individually.
? I must be misunderstanding, because thatʼs already how
`describe-repeat-maps' works.
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Tue, 17 Dec 2024 19:07:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 74903 <at> debbugs.gnu.org (full text, mbox):
>> It would be nice if users will be able first to see keymap tables
>> in the output of `describe-repeat-maps', then click on a map
>> variable, and see the same keymap table individually.
>
> ? I must be misunderstanding, because thatʼs already how
> `describe-repeat-maps' works.
I meant that after clicking on the map variable in the heading
it could show the same keymap.
BTW, I just finally fixed `describe-repeat-maps' to use the very
useful function 'cl--map-keymap-recursively' instead of 'map-keymap'.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Wed, 18 Dec 2024 00:23:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 74903 <at> debbugs.gnu.org (full text, mbox):
Monnier> AFAICT his proposal does not add any new command
(help or Monnier> other). What am I missing?
I think the confusion originates in a misunderstanding between my
initial mail and Eli's initial response where Eli said:
Eli> We have "C-h b" and "C-h m" which show the bindings,
albeit not Eli> by keymap.
Most further responses seem to assume that I want to reimplement
`describe-bindings' (C-h b).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Wed, 18 Dec 2024 12:06:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 74903 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Tue, 17 Dec 2024 21:00:11 +0200, Juri Linkov <juri <at> linkov.net> said:
>>> It would be nice if users will be able first to see keymap tables
>>> in the output of `describe-repeat-maps', then click on a map
>>> variable, and see the same keymap table individually.
>>
>> ? I must be misunderstanding, because thatʼs already how
>> `describe-repeat-maps' works.
Juri> I meant that after clicking on the map variable in the heading
Juri> it could show the same keymap.
Thatʼs just narrowing the buffer, no? 😉
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Wed, 18 Dec 2024 17:30:02 GMT)
Full text and
rfc822 format available.
Message #41 received at 74903 <at> debbugs.gnu.org (full text, mbox):
> >>> It would be nice if users will be able first to see keymap tables
> >>> in the output of `describe-repeat-maps', then click on a map
> >>> variable, and see the same keymap table individually.
> >>
> >> ? I must be misunderstanding, because thatʼs already how
> >> `describe-repeat-maps' works.
>
> Juri> I meant that after clicking on the map variable in the heading
> Juri> it could show the same keymap.
>
> Thatʼs just narrowing the buffer, no? 😉
Except that it also shows a docstring and a link to source code.
Information forwarded
to
mekeor <at> posteo.de, rpluim <at> gmail.com, eliz <at> gnu.org, stefankangas <at> gmail.com, acorallo <at> gnu.org, monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Tue, 24 Dec 2024 22:56:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 74903 <at> debbugs.gnu.org (full text, mbox):
I had accidentally sent following email only to Stefan Monnier
rather than the whole list. I'm thus sending it again.
On Mon, 16 Dec 2024 22:03:22 -0500, Stefan Monnier
<monnier <at> iro.umontreal.ca> 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?
Information forwarded
to
rpluim <at> gmail.com, eliz <at> gnu.org, stefankangas <at> gmail.com, acorallo <at> gnu.org, monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Tue, 24 Dec 2024 23:15:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 74903 <at> debbugs.gnu.org (full text, mbox):
Resending an email that I mistakenly had only sent to Stefan
Monnier:
On Mon, 16 Dec 2024 22:03:22 -0500, Stefan Monnier
<monnier <at> iro.umontreal.ca> 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?
bug closed, send any further explanations to
74903 <at> debbugs.gnu.org and Mekeor Melire <mekeor <at> posteo.de>
Request was from
Mekeor Melire <mekeor <at> posteo.de>
to
control <at> debbugs.gnu.org
.
(Tue, 24 Dec 2024 23:16:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Tue, 24 Dec 2024 23:20:02 GMT)
Full text and
rfc822 format available.
Message #52 received at 74903 <at> debbugs.gnu.org (full text, mbox):
I'd like to close this feature request because maintainers didn't agree
with my vision. Thank y'all nevertheless. :)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#74903
; Package
emacs
.
(Wed, 25 Dec 2024 12:05:02 GMT)
Full text and
rfc822 format available.
Message #55 received at 74903-done <at> debbugs.gnu.org (full text, mbox):
> From: Mekeor Melire <mekeor <at> posteo.de>
> Date: Tue, 24 Dec 2024 23:19:45 +0000
>
> I'd like to close this feature request because maintainers didn't agree
> with my vision. Thank y'all nevertheless. :)
Thanks, done.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 22 Jan 2025 12:24:09 GMT)
Full text and
rfc822 format available.
This bug report was last modified 145 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.