Closed josephwright closed 7 years ago
With the example
\RequirePackage{etoolbox} \DeclareRobustCommand\foo[2][]{} \expandafter\show\csname foo \endcsname \robustify\foo \expandafter\show\csname foo \endcsname
the robustify procedure makes \foo a \protected version of the LaTeX kernel \foo[space]. The code in etoolbox has
\foo
\protected
\foo[space]
etoolbox
\if@tempswa \ifcsdef{\string#1 } {} {\csundef{\expandafter\@gobble\string#1 }}%
but the logic here seems odd/wrong.
Need to check exactly what the LaTeX kernel does in all cases and make sure we leave only the 'required' parts about.
It does undefine. Just \show\csname it makes as a \relax
\let \fee\etb@undefined \show\fee > \fee=undefined. l.22 \show\fee \expandafter\show \csname fee\endcsname > \fee=\relax. <recently read> \fee
With the example
the robustify procedure makes
\foo
a\protected
version of the LaTeX kernel\foo[space]
. The code inetoolbox
hasbut the logic here seems odd/wrong.
Need to check exactly what the LaTeX kernel does in all cases and make sure we leave only the 'required' parts about.