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: Thu, 17 Feb 2022 12:43:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Juri Linkov <juri@linkov.net> writes:

> Is this a promising direction?

[...]

> +  (setq-local outline-level (lambda () (if (eq (char-after) ?\() 2 1)))
> +  (setq-local outline-search-function
> +              (lambda (&optional looking-at)
> +                (save-excursion
> +                  (let* ((prop-at (if looking-at
> +                                      (get-text-property (point) 
> 'shortdoc-section)
> +                                    t))
> +                         (prop-match (and prop-at 
> (text-property-search-forward 'shortdoc-section))))
> +                    (when prop-match
> +                      (set-match-data (list (prop-match-beginning prop-match)
> +                                            (prop-match-end prop-match)))
> +                      t))))))

No, I was thinking that modes like this would just put a text property
like `outline-heading' (or even just `heading') on the heading, and then
outline-minor-mode would use that.

I.e., we make modes that generate buffers provide semantics for the data
it's inserted, and then outline-minor-mode reacts to those semantics.

-- 
(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]