groff
[Top][All Lists]
Advanced

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

Re: [Groff] strings with arguments


From: Werner LEMBERG
Subject: Re: [Groff] strings with arguments
Date: Fri, 12 Jul 2002 04:19:40 +0200 (CEST)

> > The only clean solution to this
> > problem would be to introduce a new variant of the `de' request to
> > define inline macros.
> 
> Is there a possibility to copy a macro code to another macro (not by 
> aliasing)?  Then one could chop the second macro and use the suitable
> one in different situations.  For example:
> 
> .de example
> .  nop ok
> ..
> .copy_macro_from exampl example
> .chop exampl
> It is
> .example
> to define t\*[exampl]ens.

This doesn't solve the general problem behind it.  Consider this
example:

.de xxx
\c
.ie n \
foo
.el \
bar
..
aaa\*[xxx]aaa
.chop xxx
aaa\*[xxx]aaa

The result is

  aaafoo aaa aaafoo

As you can see, the final `aaa' has vanished since the now missing
newline isn't there, making `aaa' part of the else clause.

My proposed variant of .de would handle all newline characters as
syntactical elements only without producing output (not affecting
calls to other macros).

Example:

  .inline xxx
  This
  is
  .yyy
  ..
  .de yyy
  a
  test.
  ..
  .xxx

    => Thisisa test.


    Werner

reply via email to

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