# AUCTeX does not compile if the local variable is already set

I'm basically want to ask the question that was asked in Tex Stackexchange but was considered off-topic there (this is the link to the question).

When I am trying to compile (using the command C-c C-c or C-c C-a) a latex document which already has the needed local variables to point to the master-file like lines below at the end:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:


or if the master-file is another file:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "fileNameOfMasterFile"
%%% End:


it does not compile and instead, just shows the following messageMaster file already set in the mini buffer.

If I simply delete the local variable %%% TeX-master: "fileNameOfMasterFile" or %%% TeX-master: t and try to compile again (using the command C-c C-c or C-c C-a) it asks for the master-file and compiles as usual. Further on, it works normally when I compile again. But if I simply close the buffer and (re-)open the file again I face the same issue.

Is it a natural behavior? If not, any idea why this happens and how I can solve it?

If needed, I have the following in my init file:

(setq-default TeX-master nil)


Add-on: I'm suspicious that this might be related to AUCTeX version. What I just explained in the question was tested on AUCTeXversion 12.2.0 and I tried with a similar setting (same init file but an older emacs) with an older version AUCTeX (12.1.2)(on a different machine) and it works as it is expected.

• Do you also have (setq TeX-parse-self t) in your init file? – Arash Esbati Jan 6 '20 at 16:27
• also tried that one. The same behaviour :( – neuroprinciplist Jan 6 '20 at 23:00

Change to (setq-default TeX-master t) and don't forget to omit the "tex" extension.