Hans Hagen wrote:
> On 9-1-2010 0:52, Tad Ashlock wrote:
>
> > ...
>
> you can try the beta with
>
> \enabletrackers[buffers.visualize]
>
> \starttext
>
> \definetyping[C] % [option=C]
> \setuptyping[C][escape=yes]
>
> \startC
> #include <stdio.h>
> int main(){
>    return 0;
>    /BTEX{\em unreachedCode;}/ETEX
> }
> \stopC
>
> \setuptyping[escape=yes]
>
> \startTEX
> /BTEX\em sometex/ETEX
> /BTEX\em sometex/ETEX \after
> \before /BTEX\em sometex/ETEX
> \before /BTEX\em sometex/ETEX \after
> \before /BTEX\em sometex/ETEX \inbetween /BTEX\em sometex/ETEX \after
> \before \after
> \stopTEX
>
> \setuptyping[TEX][escape=no]
>
> \startTEX
> /BTEX\em sometex/ETEX
> /BTEX\em sometex/ETEX \after
> \before /BTEX\em sometex/ETEX
> \before /BTEX\em sometex/ETEX \after
> \before /BTEX\em sometex/ETEX \inbetween /BTEX\em sometex/ETEX \after
> \before \after
> \stopTEX
>
> \stoptext


I did try the beta with that example and it worked, of course.  But if
I add a second \startC ... \stopC section, then it breaks.  For
example, this code (also attached as tadtest0.tex):

============================================================
\enabletrackers[buffers.visualize]

\starttext

\definetyping[C] % [option=C]
\setuptyping[C][escape=yes]

\startC
#include <stdio.h>
int main(){
    return 0;
    /BTEX{\em unreachedCode;}/ETEX
}
\stopC

\startC
printf("The second C segment doesn't work.\n");
\stopC

\stoptext
============================================================

Produces this output:

============================================================
systems         : begin file test.tex at line 3
!buffers        : mapping 'c' visualizer onto 'typing'
!buffers        : setting escape range for visualizer 'C' to /BTEX -> /ETEX
! LuaTeX error ...text/tex/texmf-context/tex/context/base/buff-ini.lua:705:
attempt to index local 'visualizer' (a number value)
stack traceback:
    ...text/tex/texmf-context/tex/context/base/buff-ini.lua:705: in
function 'set_escape'
    <main ctx instance>:1: in main chunk.
\setupcommandsintype ...rameter \c!escape \!!es )}

\doinitializeverbatim ...\everyinitializeverbatim
                                                  \relax
\nododowithbuffer ->\egroup \doinitializeverbatim
                                                  \beginofverbatimlines \ctx...
l.18 \stopC
============================================================

Tad

Attachment: tadtest0.tex
Description: TeX document

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to