From ce5ef0c3760ba0f954779f9e52d41a1ff89c210b Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 7 Apr 2023 13:09:59 +0300 Subject: [PATCH] Add option to control default outlining in C-h b * lisp/help.el (describe-bindings-outline-rules): new user option. (describe-bindings): use it instead of hardcoding "Key translations". --- etc/NEWS | 5 +++++ lisp/help.el | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index d20d9f65ac9..303b1e3c375 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -30,6 +30,11 @@ applies, and please also update docstrings as needed. * Changes in Emacs 30.1 +--- +** New user option 'describe-bindings-outline-rules'. +This user option controls outline visibility in the output buffer of +'describe-bindings' when 'describe-bindings-outline' in non-nil. + ** X selection requests are now handled much faster and asynchronously. This means it should be less necessary to disable the likes of 'select-active-regions' when Emacs is running over a slow network diff --git a/lisp/help.el b/lisp/help.el index 6eac037df2c..886c6e0acc8 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -727,6 +727,16 @@ describe-bindings-show-prefix-commands :group 'help :version "29.1") +(defcustom describe-bindings-outline-rules '((match-regexp . "Key translations")) + "Visibility rules for outlines in the output buffer of `describe-bindings'. +This is used as the value of `outline-default-rules' in the +output buffer of `describe-bindings' when +`describe-bindings-outline' is non-nil, otherwise this option +doesn't have any effect." + :type 'boolean + :group 'help + :version "30.1") + (declare-function outline-hide-subtree "outline") (defun describe-bindings (&optional prefix buffer) @@ -756,8 +766,7 @@ describe-bindings outline-minor-mode-use-buttons 'insert ;; Hide the longest body. outline-default-state 1 - outline-default-rules - '((match-regexp . "Key translations"))) + outline-default-rules describe-bindings-outline-rules) (outline-minor-mode 1) (save-excursion (goto-char (point-min)) -- 2.40.0