From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#68824: treesitter support for outline-minor-mode Date: Sat, 10 Feb 2024 19:29:20 +0200 Organization: LINKOV.NET Message-ID: <864jeg8dch.fsf@mail.linkov.net> References: <86le8667u7.fsf@mail.linkov.net> <865xza39vp.fsf@gnu.org> <86y1c6q7oh.fsf@mail.linkov.net> <86mssbbdz5.fsf@mail.linkov.net> <86zfwbwe7a.fsf@gnu.org> <86v86z9e4u.fsf@mail.linkov.net> <86eddmwzs0.fsf@gnu.org> <865xyykvp3.fsf@mail.linkov.net> <86sf21v3rj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13033"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: casouri@gmail.com, 68824@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 10 18:37:04 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rYrHk-0003H1-3W for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Feb 2024 18:37:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYrHU-0006Kw-Q8; Sat, 10 Feb 2024 12:36:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYrHT-0006Ke-Gz for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 12:36:47 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYrHT-0006As-9G for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 12:36:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYrHi-0002yF-UD for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 12:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Feb 2024 17:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68824 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68824-submit@debbugs.gnu.org id=B68824.170758661911389 (code B ref 68824); Sat, 10 Feb 2024 17:37:02 +0000 Original-Received: (at 68824) by debbugs.gnu.org; 10 Feb 2024 17:36:59 +0000 Original-Received: from localhost ([127.0.0.1]:56966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYrHf-0002xc-CW for submit@debbugs.gnu.org; Sat, 10 Feb 2024 12:36:59 -0500 Original-Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:41177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYrHd-0002wz-A0 for 68824@debbugs.gnu.org; Sat, 10 Feb 2024 12:36:57 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id EA157E0002; Sat, 10 Feb 2024 17:36:34 +0000 (UTC) In-Reply-To: <86sf21v3rj.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Feb 2024 21:25:36 +0200") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279766 Archived-At: >> >> >> +@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