GNU bug report logs - #74412
31.0.50; Treesit-outline conflict with outli in Emacs 31

Previous Next

Package: emacs;

Reported by: Taka Obsid <liaotx2 <at> gmail.com>

Date: Mon, 18 Nov 2024 05:05:03 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Daan Ro <daanturo <at> gmail.com>
Cc: 74412 <at> debbugs.gnu.org, liaotx2 <at> gmail.com
Subject: bug#74412: 31.0.50; Treesit-outline conflict with outli in Emacs 31
Date: Thu, 21 Nov 2024 11:07:14 +0200
> Date: Thu, 21 Nov 2024 15:16:14 +0700
> From: Daan Ro <daanturo <at> gmail.com>
> Cc: "liaotx2 <at> gmail.com" <liaotx2 <at> gmail.com>, 
>  "74412 <at> debbugs.gnu.org" <74412 <at> 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.





This bug report was last modified 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.