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% {\@EA\pushmacro\csname\@@XMLelement:#1/\endcsname \@EA\pushmacro\csname\@@XMLelement:#1\endcsname \@EA\pushmacro\csname\@@XMLelement:/#1\endcsname}
\def\popXMLmeaning#1% {\@EA\popmacro\csname\@@XMLelement:#1/\endcsname \@EA\popmacro\csname\@@XMLelement:#1\endcsname \@EA\popmacro\csname\@@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: spepping@scaprea.hobby.nl home page: http://scaprea.hobby.nl