I'm trying to use the TikZ 'external' library, available as of PGF 2.10. This requires running pdfLaTeX with the option -shell-escape. I usually run pdfLaTeX from AUCTeX with the option
(TeX-PDF-mode t)
So C-c C-c runs pdfLaTeX. Can I add a line to my LaTeX file so that AUCTeX will know to run pdfLaTeX with the -shell-escape option for this file only, seeing as this is apparently a security issue, and only partially enabled by default? I don't know if this is possible, but similar things are possible. See for example the tex.sx question Force different TeX engine for specific files. If possible this would presumably use file variables.
If not, I know it is possible to customize it globally for all files in .emacs. Currently, I'm not sure how to do that either. Preferably via M-x customize, but I find those menus quite confusing
See for example http://thread.gmane.org/gmane.emacs.auctex.general/538 where David Kastrup seems to suggest that the per file approach is possible. Ie.
"Anyway, you could use the file variable section to change the command just in those files where you want it."
Also see http://thread.gmane.org/gmane.emacs.auctex.general/710
UPDATE: Based on input from the auctex mailing list, the answers suggested by people here should work. It is not clear why it doesn't, but the problem may be specific to the Debian package. Marcus Frings pointed me to his bug report in the thread above. The bottom line is there appears to be a problem with the Debian package, which is not present in vanilla auctex, and nobody knows why. The maintainer, who one would expect to look into this, shows no interest in doing so, unfortunately.