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: Juri Linkov
Subject: Re: An anonymous IRC user's opinion
Date: Wed, 20 Nov 2024 19:36:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)

>>> +(defvar treesit--mode-associations
>>> +  '((javascript-mode . js-ts-mode )
>>> +    (c-or-c++-mode . c-or-c++-ts-mode)
>>> +    (c-mode . c-ts-mode)
>>> +    (c++-mode . c++-ts-mode)
>>> +    ("\\.elixir\\'" . elixir-ts-mode)
>>> +    ("\\.ex\\'" . elixir-ts-mode)
>>> +    ("\\.go\\'" . go-ts-mode)
>>> +    ;; And so on.
>>> +    ;; Some info needed for interpreter-mode-alist as well.
>>> +    ))
>>> +
>>> +(defcustom treesit-enable-modes nil
>>> +  "Non-nil to enable tree-sitter modes during Emacs's startup."
>>> +  :type 'boolean
>>> +  :version "31.1"
>>> +  :set #'treesit-enable-modes--set)
>>
>> This could support a list to enable ts-modes selectively,
>> e.g. (setq treesit-enable-modes '(elixir-ts-mode js-ts-mode))
>> to not enable 'c-ts-mode', etc.
>
> I might have missed something, but how would that then differ from
> configuring `major-mode-remap-alist' appropriately?

Maybe because it would be a little easier to customize?

But you are right, `major-mode-remap-alist' is already
easy to use.  And customizing it has much more predictable
result than enabling ts-modes by loading .el files.



reply via email to

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