]> git.eshelyaron.com Git - emacs.git/commitdiff
Provide decent documentation for 'help-quick'
authorEli Zaretskii <eliz@gnu.org>
Thu, 4 Jan 2024 08:17:30 +0000 (10:17 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 6 Jan 2024 16:15:37 +0000 (17:15 +0100)
* lisp/help.el (help-quick, help-quick-toggle): Doc fix.

* doc/emacs/help.texi (Help Summary, Misc Help): Document
'help-quick-toggle'.

(cherry picked from commit a2a6619b2825c3c3d159610f0cd6fd89b791bd3f)

doc/emacs/help.texi
lisp/help.el

index c9fa4cbb077f124ee7e5f9af3f0333f5a0f2ee5a..39888cac6d415239f5b77ceeaa9d7a03ca64d191 100644 (file)
@@ -115,6 +115,9 @@ Display a list of commands whose names match @var{topics}
 Display all active key bindings; minor mode bindings first, then those
 of the major mode, then global bindings (@code{describe-bindings}).
 @xref{Misc Help}.
+@item C-h C-q
+Toggle display of a window showing popular commands and their key
+bindings.  @xref{Misc Help}.
 @item C-h c @var{key}
 Show the name of the command that the key sequence @var{key} is bound
 to (@code{describe-key-briefly}).  Here @kbd{c} stands for
@@ -710,6 +713,18 @@ displays the contents of the syntax table, with explanations of each
 character's syntax (@pxref{Syntax Tables,, Syntax Tables, elisp, The
 Emacs Lisp Reference Manual}).
 
+@kindex C-h C-q
+@findex help-quick-toggle
+@findex help-quick
+@cindex cheat sheet of popular Emacs commands
+  @kbd{C-h C-q} (@code{help-quick-toggle}) toggles on and off the
+display of a buffer showing the most popular Emacs commands and their
+respective key bindings (a.k.a.@: ``cheat sheet'').  The contents of
+that buffer are created by the command @code{help-quick}.  Each key
+binding shown in this buffer is a button: click on it with
+@kbd{mouse-1} or @kbd{mouse-2} to show the documentation of the
+command bound to that key sequence.
+
 @findex describe-prefix-bindings
   You can get a list of subcommands for a particular prefix key by
 typing @kbd{C-h}, @kbd{?}, or @key{F1}
index a551dba5fe52321c215a9fed8ae5112b934cdefb..72a4f8a800dc7790a0c3dfba7a25bd6ec8c143f8 100644 (file)
@@ -171,7 +171,10 @@ buffer.")
 
 ;; Inspired by a mg fork (https://github.com/troglobit/mg)
 (defun help-quick ()
-  "Display a quick-help buffer."
+  "Display a quick-help buffer showing popular commands and their bindings.
+The window showing quick-help can be toggled using \\[help-quick-toggle].
+You can click on a key binding shown in the quick-help buffer to display
+the documentation of the command bound to that key sequence."
   (interactive)
   (with-current-buffer (get-buffer-create "*Quick Help*")
     (let ((inhibit-read-only t) (padding 2) blocks)
@@ -246,10 +249,14 @@ buffer.")
       ;; ... and shrink it immediately.
       (fit-window-to-buffer))
     (message
-     (substitute-command-keys "Toggle the quick help buffer using \\[help-quick-toggle]."))))
+     (substitute-command-keys "Toggle display of quick-help buffer using \\[help-quick-toggle]."))))
 
 (defun help-quick-toggle ()
-  "Toggle the quick-help window."
+  "Toggle display of a window showing popular commands and their bindings.
+This toggles on and off the display of the quick-help buffer, which shows
+popular commands and their bindings as produced by `help-quick'.
+You can click on a key binding shown in the quick-help buffer to display
+the documentation of the command bound to that key sequence."
   (interactive)
   (if (and-let* ((window (get-buffer-window "*Quick Help*")))
         (quit-window t window))