From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#68824: treesitter support for outline-minor-mode Date: Tue, 30 Jan 2024 21:21:30 +0200 Message-ID: <865xza39vp.fsf@gnu.org> References: <86le8667u7.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37560"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 68824@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 30 20:23:20 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 1rUthY-0009YB-Fb for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jan 2024 20:23:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUthA-0004Sz-BS; Tue, 30 Jan 2024 14:22:56 -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 1rUth8-0004Sr-W4 for bug-gnu-emacs@gnu.org; Tue, 30 Jan 2024 14:22:55 -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 1rUth7-0004Hu-Np for bug-gnu-emacs@gnu.org; Tue, 30 Jan 2024 14:22:53 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUthG-0002tp-7u for bug-gnu-emacs@gnu.org; Tue, 30 Jan 2024 14:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jan 2024 19:23: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.170664252611076 (code B ref 68824); Tue, 30 Jan 2024 19:23:02 +0000 Original-Received: (at 68824) by debbugs.gnu.org; 30 Jan 2024 19:22:06 +0000 Original-Received: from localhost ([127.0.0.1]:36782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUtgL-0002sa-VY for submit@debbugs.gnu.org; Tue, 30 Jan 2024 14:22:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUtgJ-0002s4-7D for 68824@debbugs.gnu.org; Tue, 30 Jan 2024 14:22:05 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUtg3-0003z0-NO; Tue, 30 Jan 2024 14:21:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=D7rJjM1bANx28mmHSnFSO7BoOzRfyzjizLu2hBNb5Ns=; b=lzBn5rEfurCY 88nIagfNAl4bBbM2YmKfjdTNxLSsiuQ67ts97H3ug2RgAD5E/xTQnwRwZaJ1APZXqW0n7NohFg4iF PAv7m/gwBds+4b20VVBIPnmbb+4xp/p/ZkHJGcHNqylzPShY+xTl3o+oPY/z5cGx5/sbVIapl5BOj BZ+hrcuuweVW5F3gp3SLAeSNOwAsiEcNLQ23mrg4pawjdU1tkc/cLtMr0Bey9ROwhrtwMHdj5kk2H PN3pkoHSjIABySKhBTbMYJB74bcD3yH2iqZBot1UuqNtijTMyAUcwCPirXfA9a7EZd56fv5cmmRvx Eu0zahYHJKQqq1HyTRyCQA==; In-Reply-To: <86le8667u7.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 30 Jan 2024 19:37:20 +0200) 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:279199 Archived-At: > Cc: Yuan Fu > From: Juri Linkov > Date: Tue, 30 Jan 2024 19:37:20 +0200 > > As discussed on https://lists.gnu.org/archive/html/emacs-devel/2024-01/msg00916.html > here is the patch that adds the support for outline-minor-mode to treesit.el. > It has been tested on c-ts-mode, dockerfile-ts-mode, elixir-ts-mode, heex-ts-mode, > java-ts-mode, js-ts-mode, typescript-ts-mode, css-ts-mode, html-ts-mode, toml-ts-mode. Thanks, but shouldn't this minor mode be documented more prominently in the Emacs user manual, now that there are so many major modes that support it? And since major modes that want to support it have to set up its support, I would say the ELisp manual should document that setup. IOW, it makes little sense to make this minor mode more and more prolific in Emacs, and still have almost nothing about it in our manuals. > +*** 'outline-minor-mode' is supported in tree-sitter major modes. > +It can be used in all tree-sitter major modes that set either the > +variable 'treesit-simple-imenu-settings' or 'treesit-outline-predicate'. This terse description is okay, if the ELisp manual describes these setups in more detail; alone it is insufficient. > +(defvar-local treesit-outline-predicate nil > + "Predicate used to find outline headings in a sparse tree. How do "sparse trees" enter the scene here? AFAICS, "sparse trees" is mentioned only once in the entire chapter dedicated to Tree Sitter support in the ELisp manual. Is it important to mention here the fact that the tree is sparse? > diff --git a/lisp/progmodes/heex-ts-mode.el b/lisp/progmodes/heex-ts-mode.el > index 7b53a44deb2..23e2afbaaca 100644 > --- a/lisp/progmodes/heex-ts-mode.el > +++ b/lisp/progmodes/heex-ts-mode.el > @@ -166,6 +166,12 @@ heex-ts-mode > ("Slot" "\\`slot\\'" nil nil) > ("Tag" "\\`tag\\'" nil nil))) > > + ;; Outline minor mode > + ;; Restore default value for `treesit-outline-search'. > + (kill-local-variable 'outline-regexp) > + (kill-local-variable 'outline-heading-end-regexp) > + (kill-local-variable 'outline-level) This mode seems to do something to support outline-minor-mode that is not mentioned in the NEWS entry, and neither is treesit-outline-search.