[Tex/LaTex] Force different TeX engine for specific files

auctexemacs

I use Emacs and AucTeX as my writing environment. Pleasantly, I can pick an engine (PDFTeX, LuaTeX, XeTeX) and have it execute as default for all my compilations.

However, I have one project where I need a different engine than what I use as a default. I tried setting this the Emacs way, with a local variable

%%% TeX-engine: "default"

line along with the lines that specify master file for the project, but this seems to not set the appropriate variable, and Emacs locks up completely if I try to compile without a decent value set for TeX-engine.

Is there some way to signal to XeTeX that the incoming file should be compiled with PDFTeX instead? Or some good way to signal to Emacs that this particular file should use a different program for the compilation?

Best Answer

As Philipp pointed out in a comment, but never posted as an answer, my problem was that TeX-engine expects a symbol not a string. Thus, instead of what I wrote, I needed to write

%%% TeX-engine: default

to make it all work.