emacs-devel
[Top][All Lists]
Advanced

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

Re: Turning on/off tree-sitter modes


From: Dmitry Gutov
Subject: Re: Turning on/off tree-sitter modes
Date: Sun, 24 Nov 2024 04:21:43 +0200
User-agent: Mozilla Thunderbird

On 23/11/2024 21:23, Juri Linkov wrote:
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)))
But is it okay to have a command modify a user option?  Do we have
examples of this anywhere else?
Then it could modify the variable 'major-mode-remap-defaults'.
And 'major-mode-remap-alist' will take precedence over it
when customized.

I don't have a strong opinion, but it seems like if a variable is modified by explicit command from the user, major-mode-remap-alist seems more appropriate than major-mode-remap-defaults (which would be about some global defaults).

Not 100% sure though - because that plan would delete the vast majority of the uses of the latter from the core (except for TeX's mappings, it seems).



reply via email to

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