From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
Date: Thu, 21 Nov 2024 11:07:14 +0200
Message-ID: <86o729q7jx.fsf@gnu.org>
References: <86ikshspsm.fsf@gnu.org>
 <85CA4585-4E56-482E-AB91-2D0046D9B659@getmailspring.com>
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="31819"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 74412@debbugs.gnu.org, liaotx2@gmail.com
To: Daan Ro <daanturo@gmail.com>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 21 10:08:35 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1tE3Ax-000880-B4
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Nov 2024 10:08:35 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1tE3AT-00048R-7Z; Thu, 21 Nov 2024 04:08:05 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tE3AR-00047z-1n
 for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 04:08:03 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1tE3AQ-00036G-D4
 for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 04:08:02 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=debbugs.gnu.org; s=debbugs-gnu-org; 
 h=References:In-Reply-To:From:Date:To:Subject;
 bh=iIjt5ga0X7xTwHOpu9DiBT9aT/+pp0KZ5lSorIKOXaU=; 
 b=qi7MAU9BNu2FwcO9OROLIMqWmTwhFd/KyICzgSrnUHlc7Q6k9aqUhFRl1XSvdrOShTTa1rmsb5j7iG7Qym/s+T+J8IpNyVlWy8BGNQCO4OUhNOE2oVIbGR0fb0R8Kl3f3oGN/5w8q9l0SzWF3eQ9sOrQ3IE1duQU4zeDIDQg/PZ52iMeU8UH3SRfo/l+tn+Od8Z/8QMQagMU/tmeD34ocsD3xG4B6OFTkmBCfmCakcpAxB65aXmye8CP7hv3O9cPqUjgDnlsk9XnL1MmhJNkOOSEaqc2bz+ID2L4TEIbEDBHLP3yCLvIdE5yhnoNnelZf2oQxV/gFHXBN5fyEES64A==;
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tE3AP-0007TK-Vl
 for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 04:08:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Eli Zaretskii <eliz@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 21 Nov 2024 09:08:01 +0000
Resent-Message-ID: <handler.74412.B74412.173218004528666@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 74412
X-GNU-PR-Package: emacs
Original-Received: via spool by 74412-submit@debbugs.gnu.org id=B74412.173218004528666
 (code B ref 74412); Thu, 21 Nov 2024 09:08:01 +0000
Original-Received: (at 74412) by debbugs.gnu.org; 21 Nov 2024 09:07:25 +0000
Original-Received: from localhost ([127.0.0.1]:49082 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1tE39p-0007SI-3S
 for submit@debbugs.gnu.org; Thu, 21 Nov 2024 04:07:25 -0500
Original-Received: from eggs.gnu.org ([209.51.188.92]:39002)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@gnu.org>) id 1tE39n-0007Ry-7R
 for 74412@debbugs.gnu.org; Thu, 21 Nov 2024 04:07:24 -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 <eliz@gnu.org>)
 id 1tE39h-0002Y6-MO; Thu, 21 Nov 2024 04:07:17 -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=iIjt5ga0X7xTwHOpu9DiBT9aT/+pp0KZ5lSorIKOXaU=; b=FTwfPCRsPLqe
 WNwC3ZUCqsrgBje70J0H1s8l5bjRsS9VnBJMKwqSedZ2ac2ax0bHvnoTlXldIcpwG/eah/BmDvt4w
 DimwQKiJ1jA/1qpCfw9r9IgTwXcIlREfrMBA1sfHOzwkI3v3tTWxQ/Kg6RZZOe9JCTzf7EBvzfUqz
 8LQwRgbE7X79626SlYWC/GNNXje9VVLtyksfSMsEmxJSaSYTeAgNNVB02gySnkALDn1LOyF95ygUt
 KlS5bwm/dNQSTM9e4mFeFhEy3LYFO+JUAXYFpJB0uSaRD7EioRsbSf7yNs6JjgNCO75xVWx7zE4Jf
 kPLhTlbftisGV6DxHdCZ5Q==;
In-Reply-To: <85CA4585-4E56-482E-AB91-2D0046D9B659@getmailspring.com> (message
 from Daan Ro on Thu, 21 Nov 2024 15:16:14 +0700)
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:295718
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/295718>

> Date: Thu, 21 Nov 2024 15:16:14 +0700
> From: Daan Ro <daanturo@gmail.com>
> Cc: "liaotx2@gmail.com" <liaotx2@gmail.com>, 
>  "74412@debbugs.gnu.org" <74412@debbugs.gnu.org>
> 
> Before treesit.el went to set those variables, there have been already a
> bunch of packages based on outline-minor-mode for partitioning code into
> sections using comments only by highlighting headers and providing
> navigation, folding, etc. inspired by emacs-lisp-mode's outline-regexp
> settings.
> 
> Such ones enable a feel of "literate" programming by bringing
> outline-mode features to code section delimited by headings (special
> comments like ";;;", ";; *") using just comments regardless of code
> semantic.
> 
> The above is my use of outline-minor-mode, maybe other people have
> different use cases. treesit.el makes the configuration harder by the
> additional variable setting. I wish there's a hook like
> treesit-after-major-mode-setup-hook to let people fine-tune or even undo
> settings, but of course treesit-disable-features to prevent any
> execution from the start is still better.

There's a mode hook run by every mode based on treesit.el, so if the
settings by treesit.el are inappropriate, and the major mode itself
somehow decided to use them anyway, and the user doesn't like that,
the user should be able to countermand the treesit.el settings in that
mode hook.

In addition, packages that use outline-minor-mode in ways that are
incompatible with what treesit.el does should be able to reset these
variables to nil or to some other function, as they need.

The purpose of treesit.el doing this is to make it easier for
treesit-based modes to set up their support for outline-minor-mode, so
that we won't need to perform the same settings in every major mode
based on tree-sitter.  I don't see anything wrong here.  Modes and
packages which for some reason don't like that should override these
values, and that is easy enough to do without adding any user options.
Let's keep in mind that every new user option makes Emacs more complex
to use for users, which need to learn about the option and modify
their init files.  Instead, modes and packages should DTRT by default
without requiring users to get their (mode's) act together.