bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#53981: 28.0.91; shortdoc: Add support for outline-minor-mode


From: Lars Ingebrigtsen
Subject: bug#53981: 28.0.91; shortdoc: Add support for outline-minor-mode
Date: Mon, 14 Feb 2022 12:06:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Daniel Mendler <mail@daniel-mendler.de> writes:

> The shortdoc buffer currently lacks support for the outline-minor-mode.
> By setting the two variables outline-regexp and outline-level, we can
> unlock this feature. Does it make sense to provide this by default?
>
> (defun shortdoc--outline-level () (if (eq (char-after) ?\() 2 1)))
> (add-hook 'shortdoc-mode-hook
>           (lambda ()
>             (setq-local outline-level #'shortdoc--outline-level
>                         outline-regexp "[A-Z(]")))

I tried the following:

diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 658edd6752..fd79cf5116 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -1435,7 +1435,10 @@ shortdoc-mode-map
 
 (define-derived-mode shortdoc-mode special-mode "shortdoc"
   "Mode for shortdoc."
-  :interactive nil)
+  :interactive nil
+  (setq-local outline-level (lambda ()
+                              (if (eq (char-after) ?\() 2 1))
+              outline-regexp "[A-Z(]"))
 
 (defun shortdoc--goto-section (arg sym &optional reverse)
   (unless (natnump arg)

But then hiding levels made the display pretty weird:

PNG image

So if we want that, it needs more work.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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