Hello,
this is another request from it.comp.software.tex: reimplementing
xspace. By itself the thing is pretty easy, you just need the
code:
\catcode`\@=11
\protected\def\xspace{\futurelet\@let@token\@xspace}
\def\@xspace{%
\ifx\@let@token\bgroup\else
\ifx\@let@token\egroup\else
\ifx\@let@token\/\else
\ifx\@let@token\ \else
\ifx\@let@token~\else
\ifx\@let@token.\else
\ifx\@let@token!\else
\ifx\@let@token,\else
\ifx\@let@token:\else
\ifx\@let@token;\else
\ifx\@let@token?\else
\ifx\@let@token/\else
\ifx\@let@token'\else
\ifx\@let@token)\else
\ifx\@let@token-\else
%\ifx\@let@token\@xobeysp\else %this would be
% %nobreakspace
\ifx\@let@token\space\else
\ifx\@let@token\blankspace\else
\space
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
\catcode`\@=12
so the problem is rather on how to integrate this with the rest of
ConTeXt: there are some features of ConTeXt (e.g. logos,
abbreviations) for which obeying spaces should be an option. Right
now, you have to do something like:
\logo[tempTEX]{\TeX}
\def\TEX{\tempTEX\xspace}
to achieve the same result.
Any comments?