Am 08.11.2011 um 18:59 schrieb Hans Hagen:

> On 7-11-2011 09:46, Wolfgang Schuster wrote:
>> Hi Hans,
>> 
>> there is a extra space at the end of the buffer content.
>> 
>> \def\starttest
>>   {\dowithbuffer{testbuffer}{starttest}{stoptest}\relax\processtest}
>> 
>> \def\processtest{“\ctxcommand{getbuffer("testbuffer")}”}
>> %\def\processtest{“\ctxcommand{getbuffer("testbuffer")}\removeunwantedspaces”}
>> 
>> \starttext
>> 
>> \starttest TEST\stoptest
>> 
>> \starttest TEST \stoptest
>> 
>> \stoptext
> 
> It's a side effect of going through a file as tex then adds an endlinechar to 
> the end of the file; you can try that with:
> 
> \endlinechar=-1 just before the test code
> 
> The \scantokens command has the same side effect.
> 
> I've added \enabletrackers[buffers.grab] to track what gets into the buffer.
> 
> The reason for this space is probably look-ahead although it makes perfect 
> sense to have a mode for tex where no such space is added (probably then on a 
> per file basis, maybe as part of the opener callback in luatex.
> 
> In vmode the space is basically a nil, in hmode a \removeunwantedspaces is 
> needed (as with other files).
> 
> You can use buffers.getcontent to get the content directly (which might have 
> catcode side effects.
> 
> \def\processtest{“\ctxlua{context(buffers.getcontent("testbuffer"))}”}

Thanks for the explanation, buffers.getcontent does help in my case.

Wolfgang
_______________________________________________
dev-context mailing list
dev-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/dev-context

Reply via email to