On Tue, Sep 30, 2003 at 10:04:11AM +0200, Hans Hagen wrote:
> At 20:30 29/09/2003 +0200, you wrote:
> >I use it in the same way as let, but for XML environments. For
> >example,
> >
> >store the current value
> >\letXMLenvironment{origindexterm}{indexterm}%
> >redefine XML environment indexterm,
> >do some work,
> >restore the old value
> >\letXMLenvironment{indexterm}{origindexterm}}
> 
> in that case:
> 
> \expandafter\pushmacro\csname...\endcsname
> \expandafter\popmacro\csname ...\endcsname
> 
> is nicer since it works nested as well
> 
> wo maybe we should have: \pushXMLmeaning \popXMLmeaning
> 
> \def\pushXMLmeaning#1%
>   [EMAIL PROTECTED]@@XMLelement:#1/\endcsname
>    [EMAIL PROTECTED]@@XMLelement:#1\endcsname
>    [EMAIL PROTECTED]@@XMLelement:/#1\endcsname}
> 
> \def\popXMLmeaning#1%
>   [EMAIL PROTECTED]@@XMLelement:#1/\endcsname
>    [EMAIL PROTECTED]@@XMLelement:#1\endcsname
>    [EMAIL PROTECTED]@@XMLelement:/#1\endcsname}
> 
> Does that suit your needs?

I have never used \pushmacro, but if I see it right, it pushes the
macro on a stack for later restore. That would suit the example I have
given. But it would not always satisfy me. For example, when I want to
use a predefined value as the new value:

store the current value
\pushXMLmeaning{indexterm}%
redefine XML environment indexterm,
  e.g. as \letXMLenvironment{indexterm}{specialindexterm}
do some work,
restore the old value
\popXMLmeaning{indexterm}

Regards, Simon

-- 
Simon Pepping
email: [EMAIL PROTECTED]
home page: http://scaprea.hobby.nl

_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to