Package: Emacs Version: 30.0.50 If I open a file `foo.tex` with a local variable setting of `TeX-master: "paper.tex"` and that `paper.tex` file has a local variable setting of `TeX-master: t`, I get the funny behavior that Emacs first asks me whether to obey the `TeX-master: t` setting of `paper.tex` before asking me whether to obey the `TeX-master: "paper.tex"` setting of `foo.tex`, even though it obviously had to use the `TeX-master: "paper.tex"` setting in order to decide to open the `paper.tex` file (and ask me about its `TeX-master: t`). The corresponding backtrace looks as below: Debugger entered--Lisp error: (minibuffer-quit) #() read-char-from-minibuffer("Please type y, n, ! or i, or C-v/M-v to scroll: " (33 105 121 110 32)) read-char-choice("Please type y, n, ! or i, or C-v/M-v to scroll: " (33 105 121 110 32)) hack-local-variables-confirm(((TeX-master . t)) ((TeX-master . t)) nil nil) hack-local-variables-filter(((TeX-master . t)) nil) hack-local-variables(no-mode) run-mode-hooks(latex-mode-hook) latex-mode() set-auto-mode-0(latex-mode nil) set-auto-mode() normal-mode(t) after-find-file(nil nil) find-file-noselect-1(# ".../paper.tex" t nil ".../paper.tex" (3064599 65026)) find-file-noselect("paper.tex" t) latexenc-find-file-coding-system((insert-file-contents ".../foo.tex" t nil nil nil)) insert-file-contents(".../foo.tex" t) find-file-noselect-1(# ".../foo.tex" nil nil ".../foo.tex" (3064581 65026)) find-file-noselect(".../foo.tex") command-line-1((".../foo.tex")) command-line() normal-top-level() showing that the problem is that `latexenc-find-file-coding-system` is the function that opens `paper.tex` before the users had a chance to confirm that they think this is safe. I suggest the patch below which makes `latexenc-find-file-coding-system` use `safe-local-variable-p` before using a file-local setting, and also adds corresponding `safe-local-variable` settings for `TeX-master` and `tex-main-file`. Stefan