aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEshel Yaron2023-04-07 13:09:59 +0300
committerEli Zaretskii2023-04-24 14:42:00 +0300
commit2ef6f943abd41747aa733c0f51e08dfd44ddb82a (patch)
tree157ab9e890a0a9f06feb3823c791739556e26da7
parent62e4eb8fcf71a852117b372809bd4a7953f9b679 (diff)
downloademacs-2ef6f943abd41747aa733c0f51e08dfd44ddb82a.tar.gz
emacs-2ef6f943abd41747aa733c0f51e08dfd44ddb82a.zip
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". (Bug#62708)
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/help.el13
2 files changed, 16 insertions, 2 deletions
diff --git a/etc/NEWS b/etc/NEWS
index ca529be7aa1..4c5f50e343e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -30,6 +30,11 @@ applies, and please also update docstrings as needed.
30 30
31* Changes in Emacs 30.1 31* Changes in Emacs 30.1
32 32
33---
34** New user option 'describe-bindings-outline-rules'.
35This user option controls outline visibility in the output buffer of
36'describe-bindings' when 'describe-bindings-outline' in non-nil.
37
33** X selection requests are now handled much faster and asynchronously. 38** X selection requests are now handled much faster and asynchronously.
34This means it should be less necessary to disable the likes of 39This means it should be less necessary to disable the likes of
35'select-active-regions' when Emacs is running over a slow network 40'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 @@ Return nil if KEYS is nil."
727 :group 'help 727 :group 'help
728 :version "29.1") 728 :version "29.1")
729 729
730(defcustom describe-bindings-outline-rules '((match-regexp . "Key translations"))
731 "Visibility rules for outlines in the output buffer of `describe-bindings'.
732This is used as the value of `outline-default-rules' in the
733output buffer of `describe-bindings' when
734`describe-bindings-outline' is non-nil, otherwise this option
735doesn't have any effect."
736 :type 'boolean
737 :group 'help
738 :version "30.1")
739
730(declare-function outline-hide-subtree "outline") 740(declare-function outline-hide-subtree "outline")
731 741
732(defun describe-bindings (&optional prefix buffer) 742(defun describe-bindings (&optional prefix buffer)
@@ -756,8 +766,7 @@ or a buffer name."
756 outline-minor-mode-use-buttons 'insert 766 outline-minor-mode-use-buttons 'insert
757 ;; Hide the longest body. 767 ;; Hide the longest body.
758 outline-default-state 1 768 outline-default-state 1
759 outline-default-rules 769 outline-default-rules describe-bindings-outline-rules)
760 '((match-regexp . "Key translations")))
761 (outline-minor-mode 1) 770 (outline-minor-mode 1)
762 (save-excursion 771 (save-excursion
763 (goto-char (point-min)) 772 (goto-char (point-min))