From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Yuan Fu <casouri@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
Date: Sat, 23 Nov 2024 12:46:18 -0800
Message-ID: <983F9100-E76A-4F92-890A-7B2136C3B8E8@gmail.com>
References: <86ikshspsm.fsf@gnu.org>
 <85CA4585-4E56-482E-AB91-2D0046D9B659@getmailspring.com>
 <86o729q7jx.fsf@gnu.org>
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\))
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="9767"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 74412@debbugs.gnu.org, liaotx2@gmail.com, Daan Ro <daanturo@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 23 21:48:29 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 1tEx3N-0002P8-7w
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Nov 2024 21:48:29 +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 1tEx2y-0002zq-T5; Sat, 23 Nov 2024 15:48:06 -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 1tEx2w-0002zT-Ji
 for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 15:48:02 -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 1tEx2w-0007za-Bg
 for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 15:48: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:Date:In-Reply-To:From:Mime-Version:To:Subject;
 bh=5Qpx5JYE1ECumbCVkrmYfi2dupgEJ6MxCD+1lDVVlyY=; 
 b=gFt1h0ENYY4TjPCwheknD5YXTWu2hwSABilU8L4ypkCClMu1Owkcj1bUqjM7CLGDhs62eTiPmusOuf2rVg2DaRbezz1OFVDas8AzMV2NYsFtg9NLmS4374ksJECdBDzts2g6Tv7rtfPOo1cVxYW7yyyBDWZMXk7V7RJ0dmKFrF5TOtxu5QRT83uv7V0+d+IyCSklsirzDnh2tcW2QFtspGUvkWncqfgcGUXbQgwVLTlctTkcuq3UzD+5NYdb2UpUm6REThLlyLq8wDtzm+foT+S/89w3hEktvQ4zl4QZ3hICSVApQW9VHPrcA4SDISII7liEYo+tgtRxJtlVFoKbDg==;
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tEx2w-0005jZ-61
 for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 15:48:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Yuan Fu <casouri@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sat, 23 Nov 2024 20:48:02 +0000
Resent-Message-ID: <handler.74412.B74412.173239485421986@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.173239485421986
 (code B ref 74412); Sat, 23 Nov 2024 20:48:02 +0000
Original-Received: (at 74412) by debbugs.gnu.org; 23 Nov 2024 20:47:34 +0000
Original-Received: from localhost ([127.0.0.1]:59618 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1tEx2T-0005iV-Ne
 for submit@debbugs.gnu.org; Sat, 23 Nov 2024 15:47:34 -0500
Original-Received: from mail-pf1-f169.google.com ([209.85.210.169]:60750)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@gmail.com>) id 1tEx2R-0005iH-Uj
 for 74412@debbugs.gnu.org; Sat, 23 Nov 2024 15:47:32 -0500
Original-Received: by mail-pf1-f169.google.com with SMTP id
 d2e1a72fcca58-724d23df764so2365250b3a.1
 for <74412@debbugs.gnu.org>; Sat, 23 Nov 2024 12:47:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1732394791; x=1732999591; darn=debbugs.gnu.org;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=5Qpx5JYE1ECumbCVkrmYfi2dupgEJ6MxCD+1lDVVlyY=;
 b=VQn/uucxz/9NZ9bCz8EtVDRF4zc/MvCx7pqXnjTAt6NbNJVX9mRwa56XTqiB9t/69A
 VXBk3aUM/UsqyqRorYFyuO4Gf0Ay0FcO4Mfj/6KB8vYO8gSWjWjuYhxcMLUmf9ig9vCy
 a4og3JeJvDwNBGjPfDK0lDdm/pMKuCpRxs4wzznqUH8FSHwUq3JDv5b4cPcHsl0nLOBH
 0aTMT3NuN9AndDa5wMIFYmYvGX+1wfeole/EvNPHvRwmF8j7DENSm7kHbsXmXXGcXg2C
 qB5X9Pf74JwFAh/tPdZHLlhWdpbtd4ZM3A+EMVIoN2iXvtiCZZOgpA7oMAWN5PjmUVJr
 lRUA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1732394791; x=1732999591;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=5Qpx5JYE1ECumbCVkrmYfi2dupgEJ6MxCD+1lDVVlyY=;
 b=og9fMliwVLMRs60q3HG0KGtLRla8oJLGisFK21FEJxgvUIZu1DcwWtEC4/Kxjb8yfe
 gs0D5ix6u0HMKe6BuYLUhOW4FS7r85LBVZOcoKdUTTaaSurSS5np/eg0KQ3fXHH+vBkR
 NLXJmCiRl/23xuphbP/JwPQILHfYxK65JsgOHLF/lSY+is+InZYOI5wIZtk4HTgK/9c7
 HtzyxxvVID64f2lWIvuqqYIyWEO0U705aBM37YcHC71uBHyMRMaz1CN5LrXqVirgB9Ev
 Cud8R8cODP6ympUi/iEz8Gwc/YWgJIzso+HHJzOXXKu/oExsbpVNWOdjqpgRLlAc071P
 xeUw==
X-Forwarded-Encrypted: i=1;
 AJvYcCUQ7O9PuVN72lxCm3jnsKX105P7dF/ZkqtisIH5/ZA2wrI0KQY3h6WD8SIJSrj1FsWbEBgVGg==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yzupw/54CC4SNR9vmxvIcm4S8hJcBWbrBDtdjsv0QLwUZD2hICI
 zed7wmkPn5ZSaVNYEI4Y25kvuNaQNRHbezLv3piBhUdJQbXe0jY7
X-Gm-Gg: ASbGnctsdS0HiuIMG4wO01rjABoa4GkQN9i4EmT2XLiRsv+5bODh3EziFxcrk2ln5H1
 Hw88Vm22s7tu3C95rwh0hxKVFMtufs6P4z7CLoq2l8rhHnq6JhxIHrEdFJCaAThrCkK1r0bX7lT
 2QCMqFrOpkTTOmhkNgHVDpDuxjTgfeIbJd81twdAqxIW/HzLfWjQJT3SyN2F2YMFyTG6iwtrn1h
 HxdYOPF+9JmB7JSqW+3qt5I4yBQJNGloRioqeARJEEcf+W029G8rWOfq03exgMBrmXFqaTBdA==
X-Google-Smtp-Source: AGHT+IFTzYNuq2Znv9Lpn2thSibVMkPTzuhsnKX/ZpcvGEbMoZW2SvO6Vl8kPuE922DJSm+V57xGIg==
X-Received: by 2002:a05:6a00:23cc:b0:71e:4c18:8e3b with SMTP id
 d2e1a72fcca58-724df3cd479mr10917595b3a.2.1732394790851; 
 Sat, 23 Nov 2024 12:46:30 -0800 (PST)
Original-Received: from smtpclient.apple ([2601:646:8f81:6120:9db4:d34c:247c:f36b])
 by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-724de454b9dsm3755649b3a.20.2024.11.23.12.46.29
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 23 Nov 2024 12:46:30 -0800 (PST)
In-Reply-To: <86o729q7jx.fsf@gnu.org>
X-Mailer: Apple Mail (2.3776.700.51)
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:295870
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/295870>



> On Nov 21, 2024, at 1:07=E2=80=AFAM, Eli Zaretskii <eliz@gnu.org> =
wrote:
>=20
>> Date: Thu, 21 Nov 2024 15:16:14 +0700
>> From: Daan Ro <daanturo@gmail.com>
>> Cc: "liaotx2@gmail.com" <liaotx2@gmail.com>,=20
>> "74412@debbugs.gnu.org" <74412@debbugs.gnu.org>
>>=20
>> 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.
>>=20
>> 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.
>>=20
>> 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.
>=20
> 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.
>=20
> 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.
>=20
> 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.


The issue is usually that tree-sitter automatically sets =
outline-search-function, and the package that uses outline-minor-mode =
only sets outline-regexp and doesn=E2=80=99t set outline-search-function =
to nil. Since outline prioritizes outline-search-function over =
outline-regex, it appears that tree-sitter=E2=80=99s outline setting =
overrides that of the package.

Most outline-related packages don=E2=80=99t set outline-search-function =
to nil since it=E2=80=99s usually nil by default. So tree-sitter=E2=80=99s=
 behavior will surely break these packages. But since tree-sitter=E2=80=99=
s setup runs before minor modes, we can=E2=80=99t really tell if the =
user will later enable a minor mode that tree-sitter=E2=80=99s setup =
might break.

TRT here is probably for the packages to explicitly set =
outline-search-function to nil.

Yuan=