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

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

bug#68824: treesitter support for outline-minor-mode


From: Juri Linkov
Subject: bug#68824: treesitter support for outline-minor-mode
Date: Sat, 10 Feb 2024 19:29:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> >> >> +@vindex outline-search-function
>> >> >> +  Instead of setting the variable @code{outline-regexp}, you can set
>> >> >> +the variable @code{outline-search-function} to a function that
>> >> >> +matches the current heading and searches for the next one.
>> >> >
>> >> > This should tell which arguments will be passed to the function, and
>> >> > what it is expected to do and return.
>> >>
>> >> This is the Emacs User Manual, not the Emacs Lisp Reference Manual.
>> >> Are you sure that arguments should be described here?
>> >
>> > Sorry, I wasn't aware that was for the user manual.  But why are such
>> > variables documented in the user manual to begin with? why not in the
>> > ELisp manual?
>>
>> The problem is that the Info node in the ELisp manual would be too small.
>> I have no idea what to write in that node more than 10 lines from the
>> docstring of 'outline-search-function'.
>
> Why does it have to be a separate node?  Why cannot we have a
> paragraph or two about this in "Tree-sitter Major Modes", for example,
> or in "Minor Modes"?

'outline-search-function' is an internal detail of implementation
for 'treesit-outline-predicate'.  Here is the relevant part from the
previous patch that shows there is no place for 'outline-search-function:

diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index 338bf014208..48a70c171dd 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -1097,6 +1097,11 @@ Outline Format
 chapters.  This works as long as no other command starts with
 @samp{@@chap}.
 
+@vindex outline-search-function
+  Instead of setting the variable @code{outline-regexp}, you can set
+the variable @code{outline-search-function} to a function that
+matches the current heading and searches for the next one.
+
 @vindex outline-level
   You can explicitly specify a rule for calculating the level of a
 heading line by setting the variable @code{outline-level}.  The value
diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi
index ac11f88ae4d..7dd5784686b 100644
--- a/doc/lispref/parsing.texi
+++ b/doc/lispref/parsing.texi
@@ -1895,6 +1895,11 @@ Tree-sitter Major Modes
 @item
 If @code{treesit-simple-imenu-settings} (@pxref{Imenu}) is
 non-@code{nil}, it sets up Imenu.
+
+@vindex treesit-outline-predicate
+@item
+If @code{treesit-outline-predicate} is non-@code{nil}, it sets up
+Outline Minor Mode (@pxref{Outline Minor Mode,,, emacs, The GNU Emacs Manual}).
 @end itemize





reply via email to

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