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

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 17 Feb 2022 12:43:37 +0100

Juri Linkov <[email-masked]> 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