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

From: Arash Esbati <[email-masked]>
Date: Fri, 28 Feb 2025 08:52:02 +0100

Hi Paul,

"Paul D. Nelson" <[email-masked]> writes:

> Evaluating the following after Emacs -Q
>
> (progn
>   (package-initialize)
>   (package-activate 'auctex)
>   (add-hook 'LaTeX-mode-hook #'turn-on-reftex)
>   (with-temp-buffer
>     (LaTeX-mode)
>     (TeX-run-style-hooks "amsmath")))
>
> gives the backtrace:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   expand-file-name(nil)
>   reftex-TeX-master-file()
>   reftex-tie-multifile-symbols()
>   reftex-add-to-label-alist((AMSTeX))

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 :-)

HTH.  Best, Arash

Footnotes:
[1]  https://git.savannah.gnu.org/cgit/auctex.git/tree/style/amsmath.el#n165