> Date: Tue, 5 Nov 2024 22:59:09 +0200
>
> On 05/11/2024 21:53, Eli Zaretskii wrote:
> >> Suppose we have this in css-mode.el:
> >>
> >> ;;;###autoload
> >> (if (and (treesit-available-p)
> >> treesit-modes-enabled)
> >> (add-to-list 'auto-mode-alist '("\\.css\\'" . css-ts-mode)))
> >>
> >> And treesit-mode-enabled is originally nil.
> >>
> >> Then the user customizes it to t.
> >>
> >> What does its setter do? For css-ts-mode and other modes.
> >
> > It could turn the mode on in every buffer that visits a .css file. Or
> > not.
>
> Based on which information?
buffer-file-name and auto-mode-alist, I guess?
But auto-mode-alist won't have any relevant entries because when its form (above) was evaluated, treesit-modes-enabled was nil.