unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 62708@debbugs.gnu.org
Subject: bug#62708: [PATCH] Add option to control default outlining in C-h b
Date: Fri, 07 Apr 2023 13:37:56 +0300	[thread overview]
Message-ID: <m1ile85663.fsf@eshelyaron.com> (raw)

[-- 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


             reply	other threads:[~2023-04-07 10:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07 10:37 Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-04-08 12:53 ` bug#62708: [PATCH] Add option to control default outlining in C-h b 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1ile85663.fsf@eshelyaron.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=62708@debbugs.gnu.org \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).