unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#62708: [PATCH] Add option to control default outlining in C-h b
@ 2023-04-07 10:37 Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-04-08 12:53 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-04-07 10:37 UTC (permalink / raw)
  To: 62708

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

Tags: patch

Hi,

The attached patch adds a user option `describe-bindings-outline-rules`
that is used in `describe-bindings` to as the local value of
`outline-default-rules`.  This replaces a currently hard-coded setting
that takes care of hiding "Key translations" to give users more control.
For example, to also have `pixel-scroll-precision-mode` bindings
initially hidden, one can set this option to:

'((match-regexp . "Key translations\\|pixel-scroll-precision-mode"))



In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin22.4.0, NS
 appkit-2299.50 Version 13.3 (Build 22E252)) of 2023-04-06 built on
 esmac
Repository revision: 5e5f5b28e92a3bb927bb03c783c426c6c3baeadc
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2299
System Description:  macOS 13.3

Configured using:
 'configure CFLAGS=-O3 --with-native-compilation --with-json
 --with-tree-sitter'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-option-to-control-default-outlining-in-C-h-b.patch --]
[-- Type: text/patch, Size: 2294 bytes --]

From ce5ef0c3760ba0f954779f9e52d41a1ff89c210b Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@eshelyaron.com>
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.
 \f
 * 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-04-29  8:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-07 10:37 bug#62708: [PATCH] Add option to control default outlining in C-h b Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-08 12:53 ` Eli Zaretskii
2023-04-08 19:39   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-21 15:57     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-22  9:53       ` Eli Zaretskii
2023-04-23 16:35         ` Juri Linkov
2023-04-24 11:43           ` Eli Zaretskii
2023-04-29  8:07             ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).