> 1. Suppose that the file has %%% mode:latex as file variable. When emacs > opens this file, it runs `latex-mode' accordingly, which in turn runs > AUCTeX `LaTeX-mode' by redirectiton. Then it sets `major-mode' to > `LaTeX-mode'. After that, `hack-local-variables' runs; it sees that > `major mode' doesn't match the %%% mode:latex line and runs `latex-mode' > again.
Why would `hack-local-variables` do that ? AFAIK vanilla Emacs doesn't do such a thing (I just tried it in Emacs-29 to confirm). Stefan