summaryrefslogtreecommitdiff
path: root/lisp/textmodes/tex-mode.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-08-25 11:41:38 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-08-25 11:41:38 +0200
commit7782ccd6de259c14c3843cfed38d944d91b32c89 (patch)
tree4bc0abf501f5db25af137797a2c8d7c12a001e0b /lisp/textmodes/tex-mode.el
parentefaed29f3dc7af15c9f97d87f9cbe790c73a2ea3 (diff)
downloademacs-7782ccd6de259c14c3843cfed38d944d91b32c89.tar.gz
emacs-7782ccd6de259c14c3843cfed38d944d91b32c89.tar.bz2
emacs-7782ccd6de259c14c3843cfed38d944d91b32c89.zip
Fix up previous conf-mode/tex-mode redirection hacks
* lisp/textmodes/conf-mode.el (conf-mode): * lisp/textmodes/tex-mode.el (tex--redirect-to-submode): The previous hack to these redirections would disable all local variables. Try to work around this a bit more.
Diffstat (limited to 'lisp/textmodes/tex-mode.el')
-rw-r--r--lisp/textmodes/tex-mode.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 2a61e4e9a31..d7cd0aceb21 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1014,15 +1014,17 @@ says which mode to use."
(tex-common-initialization))
(advice-add 'tex-mode :around #'tex--redirect-to-submode)
+(defvar tex-mode--recursing nil)
(defun tex--redirect-to-submode (orig-fun)
"Redirect to one of the submodes when called directly."
;; The file may have "mode: tex" in the local variable
;; block, in which case we'll be called recursively
;; infinitely. Inhibit that.
- (let ((enable-local-variables nil))
- (funcall (if delay-mode-hooks
+ (let ((tex-mode--recursing tex-mode--recursing))
+ (funcall (if (or delay-mode-hooks tex-mode--recursing)
;; We're called from one of the children already.
orig-fun
+ (setq tex-mode--recursing t)
(tex--guess-mode)))))
;; The following three autoloaded aliases appear to conflict with