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

From: Jeremy Bryant <[email-masked]>
Date: Sun, 11 Feb 2024 21:32:44 +0000

> Eli Zaretskii <[email-masked]> writes:
>
>> Will the section be very long?  How long?
>>
>> If it's not very long, I think the right place is in "Key Help",
>> perhaps as a separate subsection below it.  Also, I think which-key
>> should be briefly mentioned in "Display Custom", where echo-keystrokes
>> is described.
>>
>> If the section about which-key you envision is supposed to be long and
>> detailed, perhaps it would be better to have a separate manual with
>> all that stuff, whereas the Emacs user manual should have only a short
>> description of the main features, and a cross-reference to the
>> separate manual.
>
> I would propose to make a new section short enough to belong in the main
> Emacs manual, as which-key's "keymay discovery" perspective should be
> easier to find.
>
> I can volunteer to write a draft and confer with Justin, the actual
> author, for completeness.

Attached are a proposed patch for the Emacs manual, intentionally very
short.
Feedback welcome on any aspects.

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

* doc/emacs/display.texi (Display Custom):  brief mention
* doc/emacs/help.texi (Key Help):  reference node above
---
 doc/emacs/display.texi | 3 ++-
 doc/emacs/help.texi    | 6 ++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index d2557d6148e..754f9b6d048 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 (@pxref{which-key}).
 
 @cindex mouse pointer
 @cindex hourglass pointer display
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index 99a4173ac29..25bb3ccc08a 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -260,6 +260,12 @@ Key Help
 @code{widget-describe} commands, that should be run with point over
 the button.
 
+@node which-key
+@subsection which-key
+ @command{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