Article View: comp.text
Article #2351Re: groff: copy/clone environments
From: Mark Bergman
Date: Tue, 10 Nov 1992 17:31
Date: Tue, 10 Nov 1992 17:31
61 lines
2718 bytes
2718 bytes
In article <1992Nov10.083231.6018@rc.nokia.fi> sverre@rc.nokia.fi (Sverre Slotte Jr.) writes:
>Hi groff-users (and James Clark specifically)!
>
>I have recently had the need to save many parameters of the current
>flow of text, do something else (possibly something long and complicated)
>and then return to the original flow. This "something else" could
>for instance be creating a list with new values for line lengt, font,
>point size, indent, justification etc. "Something else" could also
>occur recursively. E.g.
>
[EXAMPLES DELETED]
>
>One solution would be to identify the parameters that have to be
>saved and somehow push them on/pop them off a stack (as in -mgm).
>
>Partly because I don't know which parameters I need to save, partly
>because the idea "feels right" I would like to use environments to
>do this. By cloning the current environment and then doing the
>necessary ".ll", ".in" etc. commands I could easily create an
>environment for "Something_else_1". A simple ".ev" would then give me
>back my original environment.
>
>A command ".ev newenvironment" unfortunately creates a new environment
>with uninteresting defaults (like a 6.5 inch line lengh, not my
>current one). Hence, I need to copy the current environment into the
>new one (or copy the old one into the new one).
>
[PROGRAMMING CONCEPTS DELETED]
>
>Sverre
>
>--------------------------------------------------------------------------
>Sverre Slotte Jr. Internet: sverre@rc.nokia.fi
>Nokia Research Center Phone: + 358 0 4376208
>P.O.Box 156, 02101 Esbo, FINLAND Phax: + 358 0 4376227
>X.400 mail: G=sverre S=slotte OU=rc O=nokia ADMD=fumail C=fi
>--------------------------------------------------------------------------
>
>Wer nich liebt Wein, Weib und Gesang, der bleibt ein Narr sein Leben lang.
> Martin Luther
What about setting up each environment in a separate file,
and .so'ing each file:
.so environment
text
text
.so environment1
text style 1
text style 1
.so environment2
text style 2
.so environment
text
text
----
Mark Bergman
718-855-9148
bergman@panix.com
{cmcl2,uunet}!panix!bergman
Technical Details
Message-ID:
<1992Nov10.173136.13553@panix.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!cmcl2!panix!bergmanReferences:
<1992Nov10.083231.6018@rc.nokia.fi>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!rutgers!cmcl2!panix!bergman From: bergman@panix.com (Mark Bergman) Newsgroups: comp.text Subject: Re: groff: copy/clone environments Message-ID: <1992Nov10.173136.13553@panix.com> Date: 10 Nov 92 17:31:36 GMT References: <1992Nov10.083231.6018@rc.nokia.fi> Organization: PANIX Public Access Unix & Internet, NYC Lines: 61