Hi, does KatePart only use the configured default language ir is it smarter?

If it isn’t, let’s add language directives to syntax highlighting files, modelines, and project configurations.

modelines and project conf are straight forward: just add a lang[uage] key. modeline overrides project config.

the easiest for syntax highlighting files is just to allow a rule to catch and assign a global language. the second level would be switches within the document. the most powerful one would be that we extend contexts to optionally have a language: once a context with a language gets popped, the currently switched-to language is used. if there’s no switched-to language, we use the global one.

e.g. in a fictional TeX dialect:

\documentlanguage{en}

\begin{document}

this text is english

\language{de} % global switch

dieser text ist deutsch

\lang{fr}{ce texte est le français} %sorry, that one was google translate.

dieser text ist wieder deutsch

\end{document}