ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* definitions local to a component
@ 2006-05-18 17:57 Sanjoy Mahajan
  2006-05-18 18:11 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Sanjoy Mahajan @ 2006-05-18 17:57 UTC (permalink / raw)


What's the safe way to make \def's local to a component?  I could wrap
each component in a \begingroup..\endgroup but that might do bad
things to the output routine.

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
         --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: definitions local to a component
  2006-05-18 17:57 definitions local to a component Sanjoy Mahajan
@ 2006-05-18 18:11 ` Hans Hagen
  2006-05-19  4:06   ` Sanjoy Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2006-05-18 18:11 UTC (permalink / raw)


Sanjoy Mahajan wrote:
> What's the safe way to make \def's local to a component?  I could wrap
> each component in a \begingroup..\endgroup but that might do bad
> things to the output routine.
>   
\pushmacro\whateveryouwant

ungrouped stuff 

\popmacro\whateveryouwant


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: definitions local to a component
  2006-05-18 18:11 ` Hans Hagen
@ 2006-05-19  4:06   ` Sanjoy Mahajan
  0 siblings, 0 replies; 3+ messages in thread
From: Sanjoy Mahajan @ 2006-05-19  4:06 UTC (permalink / raw)


> \pushmacro\whateveryouwant
> ungrouped stuff 
> \popmacro\whateveryouwant

Thanks, that works.  A small example, in case others find it useful:

\starttext
\def\y{outside\par}
\y
\pushmacro\y
\def\y{inside\par}
\y
\popmacro\y
\y
\stoptext

which produces

outside
inside
outside


-Sanjoy

`Never underestimate the evil of which men of power are capable.'
         --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-19  4:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-18 17:57 definitions local to a component Sanjoy Mahajan
2006-05-18 18:11 ` Hans Hagen
2006-05-19  4:06   ` Sanjoy Mahajan

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).