unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Calling another major mode in a major mode body
@ 2022-11-21 22:07 Yuan Fu
  2022-11-22  0:44 ` Phil Sainty
  0 siblings, 1 reply; 13+ messages in thread
From: Yuan Fu @ 2022-11-21 22:07 UTC (permalink / raw)
  To: emacs-devel

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-12-10 22:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-21 22:07 Calling another major mode in a major mode body Yuan Fu
2022-11-22  0:44 ` Phil Sainty
2022-11-23  2:03   ` Yuan Fu
2022-11-23  2:15     ` Yuan Fu
2022-11-23  2:46     ` Stefan Monnier
2022-11-23 18:36       ` Yuan Fu
2022-11-23 19:21         ` Stefan Monnier
2022-12-04  7:54           ` Yuan Fu
2022-12-05 22:37             ` Richard Stallman
2022-12-05 22:50               ` Stefan Monnier
2022-12-08 23:07                 ` Richard Stallman
2022-12-09 12:56                   ` Stefan Monnier
2022-12-10 22:05                     ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).