emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: An anonymous IRC user's opinion


From: Dmitry Gutov
Subject: Re: An anonymous IRC user's opinion
Date: Tue, 19 Nov 2024 04:44:06 +0200
User-agent: Mozilla Thunderbird

On 06/11/2024 19:14, Eli Zaretskii wrote:

You wanted a user option - sure, no problem. But if taken the most
straightforward approach, the option would only have effect after
restart, and not on the current session. Otherwise it would need more
information available somehow. You asked which data - the description
was in the previous messages.
First, I still believe we can find a way of turning the enabled modes
on in the existing buffers.
Existing buffers vs new buffers is not the main issue. Getting the 
auto-mode-alist or major-mode-alias-alist entries for modes that were 
previously "off" is something we'd need a registry for.
Meaning, for example, new variables like treesit-auto-mode-alist and 
treesit-major-mode-alist-alist which would keep the associations "in 
store" until we decide to enable the modes. On balance, it seems like 
overkill.
Unless... we move all association settings from the built-in modes into 
treesit.el - then this stuff would only live in one place, at least. No 
access to the data from the "outside" => no new public vars necessary.
The way to use the attached change (the main part is in treesit.el):

  (require 'treesit)
  (setopt treesit-enable-modes t)

We could also autoload the new defcustom to make the first line unnecessary (though that's generally discouraged), or move its definition to an existing preloaded file.

Attachment: treesit-enable-modes.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]