ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Tad Ashlock <tad.ashlock@gmail.com>
To: ntg-context@ntg.nl
Cc: Hans Hagen <pragma@wxs.nl>
Subject: Re: Verbatim Text with Embedded Formatting Commands (MkIV)
Date: Fri, 29 Jan 2010 16:15:08 -0700	[thread overview]
Message-ID: <2b4e76bb1001291515s7798efecj4aac82cf12500fd6@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2382 bytes --]

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 #2: tadtest0.tex --]
[-- Type: application/x-tex, Size: 299 bytes --]

[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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	other threads:[~2010-01-29 23:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-29 23:15 Tad Ashlock [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-12-13 11:26 Tad Ashlock
2009-12-13 12:18 ` Wolfgang Schuster
2009-12-30 22:59 ` Hans Hagen
2010-01-08 23:52   ` Tad Ashlock
2010-01-11 12:32     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b4e76bb1001291515s7798efecj4aac82cf12500fd6@mail.gmail.com \
    --to=tad.ashlock@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).