for some improvement of reledmac/reledpar (https://github.com/maieul/ledmac/issues/668), I need to gobble any argument of a macro before using it in a \edef
. But I get an error.
See this MWE
\documentclass{book}
\usepackage{imakeidx}
\makeindex[name=toto,title=toto]
\makeindex
\begin{document}
s\renewcommand{\index}[1]{}
\edef\titi{\index{sncf}a}%That works
s\renewcommand{\index}[2][]{}
\edef\titi{\index[a]{sncf}a}%That does not work
\end{document}
\edef
. Withxparse
you may be able to go with\RenewExpandableDocumentCommand{\index}{om}{}
.