emacs-devel
[Top][All Lists]
Advanced

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

Re: On treesit preference for "consumer" modes


From: Eli Zaretskii
Subject: Re: On treesit preference for "consumer" modes
Date: Sat, 26 Aug 2023 20:04:10 +0300

> From: JD Smith <jdtsmith@gmail.com>
> Date: Sat, 26 Aug 2023 12:47:18 -0400
> 
> The current LANG-mode and LANG-ts-mode separation leaves some ambiguities.  
> One in particular: some modes are “consumers” of other majors modes.  That 
> is, they have a different focus, but use LANG modes as subordinate helpers 
> for some aspect of their feature set.  Examples: org-mode SRC block 
> highlighting, or a shell mode which wants to highlight and indent code 
> written at the shell prompt.  In the pre-treesit era, such a “consumer mode” 
> simply reached for, e.g., LANG-mode for this, directly making use of all the 
> customizations users have applied.
> 
> In the new era of LANG-mode and LANG-ts-mode duality, how should the consumer 
> mode decide which one to use?

A user option, I think.  There's no other reliable way ATM.

> I guess I’m looking for something like `(treesit-preferred LANG)’ or 
> `(default-major-mode LANG)’.

There's no such thing, and probably won't be, at least not soon enough
for you to rely on it.  We are still learning how to deal with this
new situation.

As for your suggestions: treesit-preferred is problematic, because no
one says the user will always prefer ts modes for all of the
languages, nor do we want to force them.  As for default-major-mode, I
don't understand how could we implement that, except by deferring to
user options again.



reply via email to

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