Subject: bug#76615: 14.0.9; error with amsmath style hooks

From: "Paul D. Nelson" <[email-masked]>
Date: Sun, 23 Mar 2025 01:53:00 +0100

Hi Ikumi,

> I think that we should minimize the change in the RefTeX behavior. How
> about the patches below, for both RefTeX and AUCTeX? It introduces a new
> flag variable and change the behavior only when the new flag has non-nil
> value.

> (...)

> @@ -390,7 +397,8 @@
>       (t
>        ;; Use buffer file name.
>        (setq master (buffer-file-name))))
> -    (expand-file-name master)))
> +    (unless reftex--suppress-nonfile-error
> +      (expand-file-name master))))
>  
>  (defun reftex-is-multi ()
>    ;; Tell if this is a multifile document.  When not sure, say yes.
>

The result of reftex-TeX-master-file is passed to file-truename, so it
can be "<none>.tex" but not nil.  Modifying your patch as follows seems
to do the trick.

Thanks, best,
Paul

@@ -389,7 +396,9 @@ reftex-TeX-master-file
      (t
       ;; Use buffer file name.
       (setq master (buffer-file-name))))
-    (expand-file-name master)))
+    (if reftex--suppress-nonfile-error
+        "<none>.tex"
+      (expand-file-name master))))
 
 (defun reftex-is-multi ()
   ;; Tell if this is a multifile document.  When not sure, say yes.