groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] removing environments


From: Werner LEMBERG
Subject: Re: [Groff] removing environments
Date: Wed, 24 May 2006 13:27:10 +0200 (CEST)

> > .  nr env-count 0 1
> > .
> > .  de CI
> > .    ev e-\\n+[env-count]
> > .    nop \&\\$*
> > .    nr have-int \\n[.int]
> > .    ev
> > .    fam C
> > .    ie \\n[have-int] \{\
> > .      I \&\\$*
> > .      fam
> > .    \}
> > .    el \
> > .      I \&\\$*\F[]
> > ..
>
> This seems to screw up for very long arguments.  I guess you need to
> evaluate the nop inside a diversion, otherwise if the argument
> results in more than one output line only the last remaining stuff
> remains in the current partial line of the environment, the
> completed lines get printed.

Yep.

> But how about this:
>
> .de CI
> .ds xx \\n[.fam]
> .fam C
> .I address@hidden
> .fam
> ..

Excellent!  This is *very* nice.  BTW, attaching something directly to
\$@ doesn't work: Saying address@hidden' as a macro argument is equivalent to
`\$@ foo'.  So this is probably the final version:

  .de CI
  .  ds xx \\n[.fam]
  .  fam C
  .  I \\$@ \F[]\F[\\*[xx]]
  .  fam
  ..

As a consequence, I'm not going to implement the removal of
environments :-)


    Werner




reply via email to

[Prev in Thread] Current Thread [Next in Thread]