emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex 4a56103 56/80: Reduce unnecessary local variable


From: Tassilo Horn
Subject: [elpa] externals/auctex 4a56103 56/80: Reduce unnecessary local variable safety inquiry
Date: Wed, 16 Oct 2019 11:07:17 -0400 (EDT)

branch: externals/auctex
commit 4a561032c2beec4ea763f83edc17f3a908ea4c79
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>

    Reduce unnecessary local variable safety inquiry
    
    * tex.el (TeX-add-local-master): Call major mode function only when
    necessary.
---
 tex.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tex.el b/tex.el
index de8c6cf..4a28e20 100644
--- a/tex.el
+++ b/tex.el
@@ -2456,11 +2456,12 @@ Get `major-mode' from master file and enable it."
         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.



reply via email to

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