Subject: Re: bug#52872: 13.0.15; wrong type argument error on calling‘LaTeX-xparse-macro-parse’

From: Arash Esbati <[email-masked]>
Date: Wed, 29 Dec 2021 16:51:31 +0100

Hi Andrea,

Andrea Greselin <[email-masked]> writes:

> after updating to AUCTeX 13.0.15 I started getting a wrong type
> argument error on opening certain .tex files. The traceback showed
> that the culprit was ‘LaTeX-xparse-macro-parse’ calling
> ‘replace-regexp-in-string’ with a nil ‘spec’ argument. If I understand
> correctly, the function is reading the ‘name’, ‘spec’ and ‘what’ local
> variables from the ‘xcmd’ list with an offset wrt to v. 13.0.14. The
> attached patch removes the offset and it’s fixed the issue for me.

Thanks for the report.  The way `LaTeX-xparse-macro-parse' works was
changed here[1] where also `LaTeX-xparse-macro-regexp' was adjusted
accordingly.  From your report, I suspect you have multiple AUCTeX
installations and the regexp for parsing is coming from an older version
and the function from a newer one.  Please restart your Emacs, open your
.tex file and hit `C-h e' and look for the directory from where
xparse.el is loaded.  If not loaded, go back to your .tex file, hit `C-c
C-n' and then check again with `C-h e'.

Best, Arash

Footnotes:
[1]  http://git.savannah.gnu.org/cgit/auctex.git/commit/style/xparse.el?id=380bc4a2ef1eceb3e8536bc3e0c7ddcc978e63e9