bug#81054: [PATCH] Add comment-prefixed outline heading recognition

Juri Linkov <[email protected]> Mon, 03 Aug 2026 19:51:27 +0300
Newsgroups gmane.emacs.bugs
Organization LINKOV.NET
Message-ID <[email protected]>
>> 1. Since 29.1, several modes set outline-search-function, which takes
>> precedence over outline-regexp.  If setup only touched outline-regexp,
>> the comment headings would never be found in those modes, defeating the
>> "works in any mode with a comment-start" goal.  So setup also does
>>  
>>   (setq-local outline-search-function nil)
>>  
>> (saving the old value), forcing the regexp path onto the comment regexp.
>> That is the right behaviour for the 't' (replace) case, and stays
>> correct for 'combined.  Let me know if you'd rather handle it another
>> way.
>
> Elisp mode sets outline-search-function to elisp-outline-search.
> This might cause a problem.

Later for the value 'combined' we could add a wrapper for
outline-search-function too that would first call the old value,
then to check whether it's in the correct heading.