emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 7a4f524314: * lisp/help.el (describe-bindings): Use the outline-d


From: Juri Linkov
Subject: master 7a4f524314: * lisp/help.el (describe-bindings): Use the outline-default-rules feature.
Date: Wed, 23 Nov 2022 13:35:36 -0500 (EST)

branch: master
commit 7a4f524314a263f0b935e4f2ce73a416b877d6f8
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/help.el (describe-bindings): Use the outline-default-rules feature.
    
    Set buffer-local outline-default-state to 1, and outline-default-rules
    to match "Key translations", instead of searching and hiding this section
    explicitly.
---
 lisp/help.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/help.el b/lisp/help.el
index f956111a52..8e1b325141 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -747,14 +747,15 @@ or a buffer name."
           (setq-local outline-level (lambda () 1))
           (setq-local outline-minor-mode-cycle t
                       outline-minor-mode-highlight t
-                      outline-minor-mode-use-buttons 'insert)
+                      outline-minor-mode-use-buttons 'insert
+                      ;; Hide the longest body.
+                      outline-default-state 1
+                      outline-default-rules
+                      '((match-regexp . "Key translations")))
           (outline-minor-mode 1)
           (save-excursion
             (goto-char (point-min))
             (let ((inhibit-read-only t))
-              ;; Hide the longest body.
-              (when (re-search-forward "Key translations" nil t)
-               (outline-hide-subtree))
               ;; Hide ^Ls.
               (while (search-forward "\n\f\n" nil t)
                (put-text-property (1+ (match-beginning 0)) (1- (match-end 0))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]