diff --git a/style/amsmath.el b/style/amsmath.el index 9d6944dc..c73f7475 100644 --- a/style/amsmath.el +++ b/style/amsmath.el @@ -163,24 +163,25 @@ (TeX-run-style-hooks "amstext" "amsbsy" "amsopn") ;; RefTeX support: Tell RefTeX about amsmath environments. - (when (fboundp 'reftex-add-to-label-alist) - (reftex-add-to-label-alist '(AMSTeX))) - - ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e' - (when (and (boundp 'reftex-ref-style-alist) - ;; check if Emacs is already equipped with this - (not (assoc "AMSmath" reftex-ref-style-alist))) - ;; Append it to a local version in order to avoid a clash with - ;; user settings - (add-to-list (make-local-variable 'reftex-ref-style-alist) - '("AMSmath" "amsmath" (("\\eqref" ?e))) - t)) - - ;; Activate `AMSmath' when `LaTeX-reftex-ref-style-auto-activate' - ;; is non-nil - (and LaTeX-reftex-ref-style-auto-activate - (fboundp 'reftex-ref-style-activate) - (reftex-ref-style-activate "AMSmath")) + (when buffer-file-truename + (when (fboundp 'reftex-add-to-label-alist) + (reftex-add-to-label-alist '(AMSTeX))) + + ;; Add \eqref to `reftex-ref-style-alist' and associate it to `e' + (when (and (boundp 'reftex-ref-style-alist) + ;; check if Emacs is already equipped with this + (not (assoc "AMSmath" reftex-ref-style-alist))) + ;; Append it to a local version in order to avoid a clash with + ;; user settings + (add-to-list (make-local-variable 'reftex-ref-style-alist) + '("AMSmath" "amsmath" (("\\eqref" ?e))) + t)) + + ;; Activate `AMSmath' when `LaTeX-reftex-ref-style-auto-activate' + ;; is non-nil + (and LaTeX-reftex-ref-style-auto-activate + (fboundp 'reftex-ref-style-activate) + (reftex-ref-style-activate "AMSmath"))) (when (and (featurep 'font-latex) (eq TeX-install-font-lock 'font-latex-setup))