Subject: Re: bug#31094: 25.2: Feature Reuqest: apropos-value: limit scope [CODE INCLUDED]

From: Juri Linkov <[email-masked]>
Date: Mon, 24 Jan 2022 21:19:07 +0200

>> In read-only buffers outline-minor-mode-highlight-buffer currently does:
>>
>>     (let ((regexp (concat "^\\(?:" outline-regexp "\\).*$")))
>>       (while (re-search-forward regexp nil t)
>>         (let ((overlay (make-overlay (match-beginning 0) (match-end 0))))
>>
>> but can use anything including special properties instead of regexps.
>
> Well, we'd add a separate loop with (text-property-search-forward
> 'outline-header) or something?

Whether to use a re-search-forward loop or a text-property-search-forward
loop could depend on a new buffer-local variable, like
hi-lock-use-overlays added to hi-lock.el.