From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mekeor Melire Newsgroups: gmane.emacs.bugs Subject: bug#74903: [PATCH] Add function to show table of keys when describing keymap variable Date: Mon, 16 Dec 2024 18:41:19 +0000 Message-ID: <37DCBABA-3D38-4FDD-8769-93E3D7F71DCE@posteo.de> References: <87v7vktu7s.fsf@posteo.de> <86zfkvpqn9.fsf@gnu.org> <87bjxb5yg5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=----PVC9TI8E67RGXQYJCSIRAJUQFZ4433 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11664"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andrea Corallo , Stefan Kangas , 74903@debbugs.gnu.org, Stefan Monnier To: Robert Pluim , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 16 19:42:29 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tNG33-0002sI-37 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Dec 2024 19:42:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNG2g-0002tU-11; Mon, 16 Dec 2024 13:42:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNG2d-0002t8-BB for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 13:42:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNG2d-0006Ub-0w for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 13:42:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=SG7T/F04uBHDLMKB1hu7Xph5CLrorjd9YrN8foK0gc4=; b=NHVOHoJAwOohST7SS3LUvZy+xQZcuo9e5tB9X6/P40Cc8/tdCxXe2qTrb/fOMA1Aq3VpqTDvHI9u/lGJbkFiRrcRz9R30bESh+5YohRkB0yGGBylEXu72igkmtwgS1sTrnsT8RZvPFIJXEc+VEU3UrYrhY7KuBn8n59DUihRY5jrGDDcdfGdoV6UAgF4XrZpn9gjfb/k3Mb0eJhBx4tjcenwNdeG9HJ9LMkydgc7W3iED5AGZMAv/TcpjSekKWdEj7yMZ3WbT0Q34kO3667oPFVxGGbwPeIk9NRyLcYTmdxB3cIrahaNotQdjgjmS8N14zTtUomDlL6RrMg+CSXsHw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNG2c-00026j-IC for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 13:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mekeor Melire Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Dec 2024 18:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74903 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74903-submit@debbugs.gnu.org id=B74903.17343744908036 (code B ref 74903); Mon, 16 Dec 2024 18:42:02 +0000 Original-Received: (at 74903) by debbugs.gnu.org; 16 Dec 2024 18:41:30 +0000 Original-Received: from localhost ([127.0.0.1]:56151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNG25-00025X-NG for submit@debbugs.gnu.org; Mon, 16 Dec 2024 13:41:30 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:40121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNG22-00025B-R7 for 74903@debbugs.gnu.org; Mon, 16 Dec 2024 13:41:29 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id F05C3240027 for <74903@debbugs.gnu.org>; Mon, 16 Dec 2024 19:41:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1734374480; bh=GHeyBQI0kuUpfZEm/a3St173NsmZD/CdzDSDYjPRdgg=; h=Date:From:To:CC:Subject:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=CeHoFntVc1/D1wRfHjUskxdsdaRuvr+Q2IIElKRbDHOonnHGJ6mdpDn+hoxg8/SeP 1Cec9ghVYJ9IprSLJPJe/nRkizYhw9cbMmAlQf5ljRKlS4knSojuy9ePBwtoDmcHNc MgX1C3dDU0eCVMODLOJN+rd+VDGT3xth75ig/uCJuGLCNpsl2lwWsHGJrq7vTQbHkK hluG/TDSvblwRw1S6r4IXhOn4m+mYYnb09AsPdxYGn2ZScEPuKDLJwinHbEKiSPFP7 usBuBDEuEbMZuI4tOVjZo1Hr21hrQTaKIMSNVYodC3kRy8FaRAjw0q7HOMNJoXSP/Z FX1poIsEX4IpQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YBpgM4Wy8z6tyZ; Mon, 16 Dec 2024 19:41:19 +0100 (CET) In-Reply-To: <87bjxb5yg5.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297211 Archived-At: ------PVC9TI8E67RGXQYJCSIRAJUQFZ4433 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On December 16, 2024 6:28:58 PM GMT+01:00, Robert Pluim wrote: >>>>>> On Mon, 16 Dec 2024 17:57:14 +0200, Eli Zaretskii = said: > > >> From: Mekeor Melire > >> Date: Sun, 15 Dec 2024 23:14:15 +0000 > >>=20 > >> 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=2E I wrote a function = that can > >> be added to help-fns-describe-variable-functions so that this happ= ens=2E > >>=20 > >> What do you think? > >>=20 > >> Alternatively, we can also add a key binding to help-mode so that = users > >> can easily "switch" from describe-variable to describe-keymap, e= =2Eg=2E per > >> "K": > >>=20 > >> 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=2E Is that not enough for some reason? > >"C-h b" shows all the bindings split out by major and minor mode >already=2E 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")=2E > > 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=2E > > Eli> What do others think about this? > >I really don=CA=BCt see the need for more functionality here=2E > >Robert >--=20 I get the impression that you talk about M-x describe-keymap RET which doe= s already exist=2E That is not what I proposed=2E What I proposed is two things: 1=2E Allow users to opt-in to have C-h v foo-keymap RET show a table of ke= y bindings in addition to the formatting as S-expression=2E This fits well = into the existing help-fns mechanism=2E The patch I submitted implements a = prototype=2E 2=2E 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 desc= ribing it as keymap a la describe-keymap=2E I proposed (2=2E) as an alternative to (1=2E) but my main proposal is (1= =2E)=2E Both approaches have a similar objection though=2E ------PVC9TI8E67RGXQYJCSIRAJUQFZ4433 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
On De= cember 16, 2024 6:28:58 PM GMT+01:00, Robert Pluim <rpluim@gmail=2Ecom&g= t; wrote:
On Mon, 16 Dec= 2024 17:57:14 +0200, Eli Zaretskii <eliz@gnu=2Eorg> said:
<= /blockquote>

From: Mekeor Meli= re <mekeor@posteo=2Ede>
Date: Sun, 15 Dec 2024 23:14:15 +0000
<= br>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=2E I wrote a function that can<= br>be added to help-fns-describe-variable-functions so that this happens=2E=

What do you think?

Alternatively, we can also add a key bind= ing to help-mode so that users
can easily "switch" from describe-variabl= e to describe-keymap, e=2Eg=2E per
"K":

C-h v message-mode-map RE= T K

Eli> We= have "C-h b" and "C-h m" which show the bindings, albeit not by
Eli= > keymap=2E Is that not enough for some reason?

"C-h b" shows al= l the bindings split out by major and minor mode
already=2E I guess we c= ould add the name of the relevant keymap as well,
but the people who nee= d to know the name of the keymap generally know
enough about Emacs to fi= gure it out (eg via "C-h k")=2E

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> functionaliti= es=2E

Eli> What do others think about this?

I really d= on=CA=BCt see the need for more functionality here=2E

Robert

I get the im= pression that you talk about M-x describe-keymap RET which does already exi= st=2E

That is not what I proposed=2E What I proposed is two things:<= br>
1=2E 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=2E This fits= well into the existing help-fns mechanism=2E The patch I submitted impleme= nts a prototype=2E

2=2E In help-mode, bind a single-char-key like "K= " to a command that will allow users to easily switch from describing a var= iable as variable to describing it as keymap a la describe-keymap=2E
I proposed (2=2E) as an alternative to (1=2E) but my main proposal is (1= =2E)=2E Both approaches have a similar objection though=2E

------PVC9TI8E67RGXQYJCSIRAJUQFZ4433--