[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Turning on/off tree-sitter modes
From: |
Juri Linkov |
Subject: |
Re: Turning on/off tree-sitter modes |
Date: |
Sat, 23 Nov 2024 19:51:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) |
>>> How about if that's done like:
>>>
>>> (setopt treesit-enable-modes '(c-ts-mode))
>>>
>>> Or maybe 'M-x treesit-add-enabled-mode' can be added too.
>> I think a command is better.
>
> Okay. It can read the mode name with completion, and then call
>
> (setopt treesit-enable-modes (cons new-mode treesit-enable-modes))
Recently Philip rightly noticed that 'major-mode-remap-alist'
would be sufficient. And indeed, such a command could be implemented
just as
(defun treesit-add-enabled-mode (non-ts-mode ts-mode)
(setopt major-mode-remap-alist
(cons (cons non-ts-mode ts-mode)
major-mode-remap-alist)))
Or the idea was to simplify this by using only ts-mode here
while maintaining a huge database of non-ts → ts mappings
in an internal variable? (that will eventually grow
into something like 'eglot-server-programs')
- Re: An anonymous IRC user's opinion, (continued)
- Re: An anonymous IRC user's opinion, Dmitry Gutov, 2024/11/21
- Re: An anonymous IRC user's opinion, Eli Zaretskii, 2024/11/21
- Re: An anonymous IRC user's opinion, Dmitry Gutov, 2024/11/21
- Re: An anonymous IRC user's opinion, Eli Zaretskii, 2024/11/22
- Re: An anonymous IRC user's opinion, Dmitry Gutov, 2024/11/22
- Re: Turning on/off tree-sitter modes (was: An anonymous IRC user's opinion), Eli Zaretskii, 2024/11/23
- Re: Turning on/off tree-sitter modes, Dmitry Gutov, 2024/11/23
- Re: Turning on/off tree-sitter modes, Eli Zaretskii, 2024/11/23
- Re: Turning on/off tree-sitter modes, Dmitry Gutov, 2024/11/23
- Re: Turning on/off tree-sitter modes, Steinar Bang, 2024/11/24
- Re: Turning on/off tree-sitter modes,
Juri Linkov <=
- Re: Turning on/off tree-sitter modes, Eli Zaretskii, 2024/11/23
- Re: Turning on/off tree-sitter modes, Juri Linkov, 2024/11/23
- Re: Turning on/off tree-sitter modes, Dmitry Gutov, 2024/11/23
- Re: Turning on/off tree-sitter modes, Stefan Monnier, 2024/11/24
- Commands that change user options? [was: Turning on/off tree-sitter modes], Drew Adams, 2024/11/24
- Re: Turning on/off tree-sitter modes, Stephen Berman, 2024/11/24
- Re: Turning on/off tree-sitter modes, Dmitry Gutov, 2024/11/23
- Re: Turning on/off tree-sitter modes, Juri Linkov, 2024/11/24
- Re: Turning on/off tree-sitter modes, Eli Zaretskii, 2024/11/24
- Re: Turning on/off tree-sitter modes, Juri Linkov, 2024/11/24