[Top][All Lists]

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

Calling another major mode in a major mode body

From: Yuan Fu
Subject: Calling another major mode in a major mode body
Date: Mon, 21 Nov 2022 14:07:27 -0800

Sometimes it would be nice for the tree-sitter mode to fallback to the 
non-tree-sitter mode, eg, when the buffer is to large. Sh-mode needs something 
similar, too, because tree-sitter only supports bash right now. If the shell is 
some other shell, the tree-sitter mode should fall back to the normal sh-mode.

Fallback in the above two cases are necessary because users can’t easily avoid 
them: currently there is no easy way to make Emacs use different major modes 
based on file size, or shell type. (You could use magic-mode-alist for shell, 
but that’s not TRT, I think)

So I wonder if it’s ok to fall back to another major mode by simply calling 
that mode.


reply via email to

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