# Why is aucTeX compiling my file like pdflatex “input” foo.tex rather than just pdflatex foo.tex?

When I compile a file using Emacs AucTeX with C-c C-c (which runs TeX-command-master which runs TeX-run-TeX) the top line of the log output looks like this:

Running `LaTeX' on `mwe' with ``pdflatex  -interaction=nonstopmode "\input" mwe.tex''

(This is the top line of the buffer when I do C-c C-l.

Why on earth is aucTeX doing "\input" mwe.tex rather than just mwe.tex? What can this possibly achieve apart from causing my %&custom fmt definition to get ignored?

And secondly, where do I stop it doing this? I've looked at how the various commands mentioned above are defined. None of them seem to specify this behaviour. So what is actually causing this invocation of pdflatex?

-
it may be related to the fact that when auctex began tex didn't have any command line arguments so you needed to do tex \nonstopmode\input mwe.tex to run a file in that mode. – David Carlisle Aug 9 '12 at 15:58
@DavidCarlisle I see. I didn't know that. That makes the behaviour make sense, I guess. – Seamus Aug 9 '12 at 16:00
I'm putting this as a comment and not an answer, since I don't have enough time now to write more, but look at the variables TeX-command-list and TeX-expand-list. (I was also dissatisfied with this default behavior and customized TeX-command-list to change it.) – mbork Aug 9 '12 at 16:00
@mbork Aha! TeX-expand-list includes %' which expands to some complicated stuff that includes the dreaded \input. That's a pretty impressive way to obfuscate your option setting. Deleting %' from the right part of TeX-command-list seems to have done the trick. – Seamus Aug 9 '12 at 16:06
@Seamus If you are still interested in the "Why on earth is aucTeX doing "\input" mwe.tex rather than just mwe.tex?" question, David Kastrup gave here an answer, more or less. – giordano Feb 18 '14 at 23:02