bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#60176: 29.0.60; Fallback file variable mode if treesitter is not usa


From: Juri Linkov
Subject: bug#60176: 29.0.60; Fallback file variable mode if treesitter is not usable
Date: Mon, 16 Jan 2023 19:32:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> (defcustom treesit-enable-modes nil
>>   :type '(repeat
>>           (choice (function-item c-ts-mode)
>>                   (function-item c++-ts-mode)
>>                   (function-item c-or-c++-ts-mode)
>>                   ...
>>              ('c-ts-mode
>>               (when (treesit-ready-p 'c t)
>>                 (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))))
>
> And this bit is completely unacceptable, from where I stand: it
> basically means that the user activated a certain major mode he/she
> wanted to use, but the result could be that an entirely different mode
> was silently activated instead.  What kind of UX is that, and for a
> shining new feature at that??

It could update 'auto-mode-alist' instead of 'major-mode-remap-alist'.
>From the user's point of view this would be more manageable than
what you proposed on emacs-devel with some obscure logic of activating
ts modes when the package is loaded or when the mode is enabled first time.





reply via email to

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