diff --git a/style/amsmath.el b/style/amsmath.el index 9d6944dc..68cd5983 100644 --- a/style/amsmath.el +++ b/style/amsmath.el @@ -163,7 +163,8 @@ (TeX-run-style-hooks "amstext" "amsbsy" "amsopn") ;; RefTeX support: Tell RefTeX about amsmath environments. - (when (fboundp 'reftex-add-to-label-alist) + (when (and (fboundp 'reftex-add-to-label-alist) + (buffer-file-name)) (reftex-add-to-label-alist '(AMSTeX))) ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e' @@ -180,6 +181,7 @@ ;; is non-nil (and LaTeX-reftex-ref-style-auto-activate (fboundp 'reftex-ref-style-activate) + (buffer-file-name) (reftex-ref-style-activate "AMSmath")) (when (and (featurep 'font-latex)