A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01409.html below:

Calling another major mode in a major mode body

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] 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.

Yuan


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4