auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-devel] Duplicated confirmation


From: Ikumi Keita
Subject: [AUCTeX-devel] Duplicated confirmation
Date: Wed, 04 Apr 2018 16:03:38 +0900

Hi all,

In a directory where dir-local variables are enabled, the confirmation
whether to accept the local variables is conducted twice under certain
condition.

[How to reproduce]
0. Eval (setq-default TeX-master nil).
1. Extract the attached test suite under /tmp.
2. Open abc.tex in the suite with AUCTeX.
3. C-x C-f xyz.tex RET
4. Then emacs asks whether to accept the local variables defined in
.dir-locals.el.  Answer with y.
5. Emacs asks master file name.  Answer with RET to accept default.
6. Then emacs asks local variables confirmation again.

The second confirmation in item 6 is a bit annoying to me.  I already
gave permission to accept those variables at item 4.

The second confirmation is done in the last of `TeX-add-local-master'.
I confirmed that I can get rid of the duplication with this change:

diff -r 8b2f9621761c -r cf6860ad84d3 tex.el
--- a/tex.el    Fri Sep 22 05:52:24 2017 +0900
+++ b/tex.el    Sun Nov 12 20:03:17 2017 +0900
@@ -2557,11 +2557,12 @@
         comment-prefix "mode: " mode-string "\n"
         comment-prefix "TeX-master: " (prin1-to-string TeX-master) "\n"
         comment-prefix "End:\n")
-       (funcall mode)
-       ;; TeX modes run `VirTeX-common-initialization' which kills all local
-       ;; variables, thus `TeX-master' will be forgotten after `(funcall
-       ;; mode)'.  Reparse local variables in order to bring it back.
-       (hack-local-variables)))))
+       (unless (eq mode major-mode)
+         (funcall mode)
+         ;; TeX modes run `VirTeX-common-initialization' which kills all local
+         ;; variables, thus `TeX-master' will be forgotten after `(funcall
+         ;; mode)'.  Reparse local variables in order to bring it back.
+         (hack-local-variables))))))
 
 (defun TeX-local-master-p ()
   "Return non-nil if there is a `TeX-master' entry in local variables spec.


However, I'm not sure whether this change has other bad side effects or
not.  How do you all think about this issue?  Any thoughts and comments
are welcome.

Regards,
Ikumi Keita

Attachment: dirlocal.tar.gz
Description: test suite


reply via email to

[Prev in Thread] Current Thread [Next in Thread]