groff
[Top][All Lists]
Advanced

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

Re: [groff] \n[.Y] in release candidates


From: Werner LEMBERG
Subject: Re: [groff] \n[.Y] in release candidates
Date: Sat, 31 Mar 2018 19:33:40 +0200 (CEST)

> In groff 1.22.4.rc2:
> 
>   $ echo '\n[.Y]' | nroff | grep .
>   4.rc2
> 
> I can see why this happens, of course; but it seems odd for a number
> register to contain non-numeric data.

Not at all.  There are many number registers that return strings.

> Failing that, can anyone suggest an improved version of this code
> emitted by man-db that doesn't trip over this ("(4.rc2 >= 2)" in a
> conditional doesn't work and ends up emitting noise to the output)?

Here it is.

  .ds Ystring \n[.Y]
  .while (\B'\*[Ystring]' = 0) .chop Ystring
  .nr Ynumber \*[Ystring]
  .
  .if (\n[.g] \
       & ((\n[.x] > 1) \
          : ((\n[.x] == 1) & (\n[.y] > 20)) \
          : ((\n[.x] == 1) & (\n[.y] == 20) & (\n[Ynumber] >= 2)))) \{\
  .  warn (\n[.warn] - (\n[.warn] / 1048576 % 2 * 1048576))
  .  mso %s.tmac
  .\}


     Werner



reply via email to

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