Hello Luigi,

thank you for proposing a solution, but it's not suitable to my needs as it modifies the content of the typing region : the backlash is displayed

I want to be able to gobble or not the typing region by using a macro without modifying it.



On 06 Nov 2014, at 12:16, luigi scarso <luigi.scarso@gmail.com> wrote:



On Thu, Nov 6, 2014 at 10:35 AM, Pierre-François Bonnefoi <bonnefoi@unilim.fr> wrote:
Hello,

I've made a lot of improvement to my slides format for my teaching material and I've run into a serious issue with gobbleinput that I can express with with simple lines :

\starttext
\gobbleuntil\stoptyping
\starttyping
{ printf("%d", data); }
\stoptyping
This is ignored ! 
\stoptext

How can I use correctly gobbleinput to make it works ?


"%d" 
in this situation means ["][ token comment ] <other tokens> 
--- \gobbleuntil neutralizes \starttyping that changes the catcode of '%'  ---
so you are left with an open group  (the { before printf)
that needs to be closed.

So the first step is to make '%' a letter token

\starttext
%\tracingall
\gobbleuntil\stoptyping
\starttyping
    { printf("\%d", data); }
\stoptyping
%\tracingnone
This is not more ignored ! 
\stoptext

 

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

-- 
Bonnefoi Pierre-Francois                |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
Universite de Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 38
123 av Albert Thomas                    |  Mrs. Peel, we're needed...
87060 Limoges CEDEX - FRANCE            |                 The Avengers.