GNU bug report logs - #76615
14.0.9; error with amsmath style hooks

Previous Next

Package: auctex;

Reported by: "Paul D. Nelson" <ultrono <at> gmail.com>

Date: Thu, 27 Feb 2025 18:31:02 UTC

Severity: normal

Found in version 14.0.9

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 76615 <at> debbugs.gnu.org (full text, mbox):

From: "Paul D. Nelson" <ultrono <at> gmail.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: 76615 <at> debbugs.gnu.org
Subject: Re: bug#76615: 14.0.9; error with amsmath style hooks
Date: Fri, 28 Feb 2025 16:21:49 +0100
[Message part 1 (text/plain, inline)]
Hi Arash,

>
> I think this is because of this part of amsmath.el[1]:
>
>    ;; RefTeX support: Tell RefTeX about amsmath environments.
>    (when (fboundp 'reftex-add-to-label-alist)
>      (reftex-add-to-label-alist '(AMSTeX)))
>
>> The issue arose when using log-edit-generate-changelog-from-diff for a
>> commit involving tex files.  I distilled it down to the above example.
>
> I'd say the form above was in amsmath.el since forever :-)
>

Indeed.

The attached patch addresses the issue for me.  Thoughts?

Paul

[Message part 2 (text/plain, inline)]
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)

This bug report was last modified 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.