Recently there have been reports of the first letter of a line of text
being lost in the database and letter modules.
I tracked down what appears to be the same problem and developed a
work-around.
The problem appears to be with the \grabbufferdata command. Something
has changed in the way it works, and it now swallows the first token of
the buffer that it grabs. It may also show up with other commands, but
this is the only one I have found in my projects.
If you have code with this command, a workaround is to insert
\ignorespaces after it. I have no idea why this helps. If you do not
have the code (if it is in somebody else's module), then using a blank
line or dummy argument or \relax after the command that calls the code
with \grabbufferdata may help.
The following code shows the issues and these workarounds.
% macros=mkvi
\starttexdefinition unexpanded startNoIgnore
\begingroup
\dostartNoIgnore
\stoptexdefinition
\starttexdefinition dostartNoIgnore
\grabbufferdata[Test][startNoIgnore][stopTest]
\stoptexdefinition
\starttexdefinition unexpanded startWithIgnore
\begingroup
\dostartWithIgnore
\stoptexdefinition
\starttexdefinition dostartWithIgnore
\grabbufferdata[Test][startWithIgnore][stopTest]
\ignorespaces
\stoptexdefinition
\starttexdefinition stopTest
\getbufferdata[Test]
\endgroup
\stoptexdefinition
\define\TestText
{\qquad If you can read this the first token was not swallowed.}
\starttext
\subject{Test without \tex{ignorespaces}}
First, the problem:
\startNoIgnore\TestText\stopTest
And the same with \type{{}}
\startWithIgnore{}\TestText\stopTest
Workaround with \tex{relax}
\startNoIgnore\relax\TestText\stopTest
Workaround with blank line
\startNoIgnore
\TestText\stopTest
\subject{Test with \tex{ignorespaces}}
This now works:
\startWithIgnore\TestText\stopTest
And the same with \type{{}}
\startWithIgnore{}\TestText\stopTest
And the same with \tex{relax}
\startWithIgnore\relax\TestText\stopTest
And the same with a blank line after the opening
\startWithIgnore
\TestText\stopTest
\stoptext
--
Rik Kabel
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________