I have lots of LaTeX files, and my AucTeX has been set up to automatically open up all *.tex files in LaTeX-mode. But more recently I've started using ConTeXt, and for those files (which also end in .tex) I'd like to use ConTeXt-mode. Is there any way of embedding something in the file which will tell Emacs to open up the correct mode?
I can start a file with, for example
-*- mode: context; -*-
which works well, but even if it's the very first line in the file, ConTeXt still parses it and writes it to the output, although it comes way before
Does anybody have any better suggestions? I suppose the sensible thing would be to move all ConTeXt files into one directory tree, and set up a
.dir-locals.el file in that directory, which would tell Emacs to open up all .tex files using ConTeXt mode. But I'd still like to be able to do it on a file-by-file basis.
FWIW, I'm using Linux.