Subject: 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 19:08:45 +0100

Andrea Greselin <[email-masked]> writes:

> the unpatched version doesn’t work for me. I’ve reinstalled
> AUCTeX (from Elpa) and restarted the computer to be sure that Emacs
> picks up everything as updated. The only mention of xparse.el or .elc
> in the Messages buffer is
>
>     Loading ~/.emacs.d/elpa/auctex-13.0.15/style/xparse.elc...done
>
> then, towards the end
>
>     Sorting xparse-macro...done
>     Removing duplicates...done
>     replace-regexp-in-string: Wrong type argument: arrayp, nil
>
> For the sake of completeness,
>
>     find ~/.emacs.d/ -name 'xparse.el*'
>
> returns
>
>     ~/.emacs.d/elpa/auctex-13.0.15/style/xparse.el
>     ~/.emacs.d/elpa/auctex-13.0.15/style/xparse.elc

Thanks for checking and reporting.  The only other source of trouble
which remains is an old parsed info file which AUCTeX loads. I can
imagine in that file, thers is an entry with `LaTeX-add-xparse-macros'
which has outdated signature.  Can you please check that as well?  You
should see that also in the Message buffer, an entry like this:

    Loading /path/to/auto/name-of-your-tex-file.el (source)...done

For checking, this is a small file I assembled:

--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{xparse}

\NewDocumentCommand \foo { > { \ReverseBoolean } s m }{
  \IfBooleanTF #1
    { \DoSomethingWithoutStar {#2} }
    { \DoSomethingWithStar {#2} }
}

\NewDocumentCommand \bar { > { \SplitArgument { 2 } { ; } } m }{
  \InternalFunctionOfThreeArguments #1
}

\begin{document}

(insert "\n" (format "%S" (LaTeX-xparse-macro-list)))

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
--8<---------------cut here---------------end--------------->8---

Save the code above as a .tex file, open it and hit `C-c C-n' twice (to
be sure).  Then eval the (insert ...) form and you'll see that the
entries retured have four elements.  That said, I can't reproduce what
you describe.

> Could it be because I’m still running TeX Live 2019? I haven’t used
> LaTeX in a while...

No, this is AUCTeX only, your TeXlive installation isn't involved.

Best, Arash