]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow showing prefix commands in Help buffers
authorEli Zaretskii <eliz@gnu.org>
Thu, 23 Mar 2023 08:31:56 +0000 (10:31 +0200)
committerEli Zaretskii <eliz@gnu.org>
Thu, 23 Mar 2023 08:31:56 +0000 (10:31 +0200)
* lisp/help.el (describe-bindings-show-prefix-commands): New user
option.
(describe-map): Use it to decide whether to output prefix
commands.  Patch by Bob Rogers <rogers@rgrjr.com>.  (Bug#62279)

* etc/NEWS: Document 'describe-bindings-show-prefix-commands'.

etc/NEWS
lisp/help.el

index 0b651f7a5191f516cd98d564098774f916613a85..d7a6cf7986d12333225596aac18a49cd5d7e536e 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3565,11 +3565,13 @@ font spec.  In these cases, replacing ":weight 'normal" with ":weight
 'medium" should fix the issue.
 
 ---
-** Keymap descriptions have changed.
+** Keymap descriptions by Help commands have changed.
 'help--describe-command', 'C-h b' and associated functions that output
 keymap descriptions have changed.  In particular, prefix commands are
-not output at all, and instead of "??" for closures/functions,
-"[closure]"/"[lambda]" is output.
+not output at all, and instead of "??" for closures/functions, these
+functions output "[closure]"/"[lambda]".  You can get back the old
+behavior of including prefix commands by customizing the new option
+'describe-bindings-show-prefix-commands' to a non-nil value.
 
 ---
 ** 'downcase' details have changed slightly.
index 83be85b1ee48981ae6391677d1e1f706dc456619..3e94b5046e5c81cab48bce43a60f2cf07c3417ec 100644 (file)
@@ -717,6 +717,12 @@ Return nil if KEYS is nil."
   :group 'help
   :version "29.1")
 
+(defcustom describe-bindings-show-prefix-commands nil
+  "Non-nil means show prefix commands in the output of `describe-bindings'."
+  :type 'boolean
+  :group 'help
+  :version "29.1")
+
 (declare-function outline-hide-subtree "outline")
 
 (defun describe-bindings (&optional prefix buffer)
@@ -1699,6 +1705,7 @@ in `describe-map-tree'."
               (setq vect (cdr vect))
               (setq end (caar vect))))
           (when (or (not (eq start end))
+                    describe-bindings-show-prefix-commands
                     ;; Don't output keymap prefixes.
                     (not (keymapp definition)))
             (when first