Subject: bug#68929: [PATCH] Copy which-key from GNU ELPA into core

From: Jeremy Bryant <[email-masked]>
Date: Sat, 17 Feb 2024 13:10:51 +0000

>From eae203569f73081e82035990a5a5ac1e0beb9083 Mon Sep 17 00:00:00 2001
From: Jeremy Bryant <[email-masked]>
Date: Sun, 11 Feb 2024 21:26:41 +0000
Subject: [PATCH 3/3] Add manual entries for which-key

* doc/emacs/display.texi (Display Custom):  Briefly introduce which-key.
* doc/emacs/help.texi (Key Help):  Briefly mention which-key.
---
 doc/emacs/display.texi | 3 ++-
 doc/emacs/help.texi    | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index d2557d6148e..bda57d2b30e 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -2215,7 +2215,8 @@ Display Custom
 default), the multi-character key sequence echo shown according to
 @code{echo-keystrokes} will include a short help text about keys which
 will invoke @code{describe-prefix-bindings} (@pxref{Misc Help}) to show
-the list of commands for the prefix you already typed.
+the list of commands for the prefix you already typed.  For a related
+help facility, see @ref{which-key}.
 
 @cindex mouse pointer
 @cindex hourglass pointer display
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index 99a4173ac29..1a76e663657 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -260,6 +260,11 @@ Key Help
 @code{widget-describe} commands, that should be run with point over
 the button.
 
+@anchor which-key
+@kbd{M-x which-key} is a global minor mode which helps in discovering
+ keymaps.  It displays keybindings following your currently entered
+ incomplete command (prefix), in a popup.
+
 @node Name Help
 @section Help by Command or Variable Name
 
-- 
2.42.0

Eli Zaretskii <[email-masked]> writes:

> LGTM, thanks.  Some minor comments below.

Revised patch attached.

>> * doc/emacs/display.texi (Display Custom):  brief mention
>> * doc/emacs/help.texi (Key Help):  reference node above
>
> The descriptions of the changes in these entries should be complete
> sentences: begin with a capital letter and end with a period.

Corrected in patch.
Thank you for explaining, I now realise this was in CONTRIBUTE.

>
>> --- a/doc/emacs/display.texi
>> +++ b/doc/emacs/display.texi
>> @@ -2215,7 +2215,8 @@ Display Custom
>>  default), the multi-character key sequence echo shown according to
>>  @code{echo-keystrokes} will include a short help text about keys which
>>  will invoke @code{describe-prefix-bindings} (@pxref{Misc Help}) to show
>> -the list of commands for the prefix you already typed.
>> +the list of commands for the prefix you already typed.  For a related
>> +help facility (@pxref{which-key}).
>
> The parentheses here don't look right.  It is better to say
>
>   For a related help facility, see @ref{which-key}.
>
>> +@node which-key
>
> It is better to use
>
>   @anchor which-key
>
> Then you don't need the @subsection at all.
>
>> + @command{M-x which-key} is a global minor mode which helps in
>
> @command is for shell commands.  Here you show something the user
> types, so the right markup is @kbd.

Corrected in patch.
Thanks, I have learnt more TeXinfo with this.