bug-groff
[Top][All Lists]
Advanced

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

[bug #57583] [PATCH] s.tmac: Test the default number for warnings for nr


From: G. Branden Robinson
Subject: [bug #57583] [PATCH] s.tmac: Test the default number for warnings for nroff
Date: Tue, 4 Feb 2020 17:32:56 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 PureBrowser/60.9.0

Follow-up Comment #4, bug #57583 (project groff):

>   Your own wording is wrong.

You're right.

> 1) .\" Enable warnings (only if none are given on the command line).

groff(7) does not document what .warn with no arguments does.  That's a
problem.

.warn with no arguments _turns all warnings on_.

But even so, you're not testing what was given on the command-line.  This
comment, which predates your patch, is misleading.  Warnings don't keep track
of what set them.  You don't know how the \n[.warn] register got set to the
value it has.  What I _think_ you're doing is checking the value of this
register against the current (groff 1.22.4) default, judging by the following
experiment:


$ for TS in utf8 ps; do printf '.tm \\n[.warn]\n' | groff -T$TS; done
1114119
1245191


Someone could specify a sequence of -w and -W arguments that reproduce the
default, and falsify your comment, because you'd still turn all the warnings
on.

So, you're right, my wording was incorrect.  It should have been

"tmac/s.tmac: Enable all warnings in nroff mode if warning register has its
default value."

Your patch makes more sense to me now.  I don't know if it is good policy for
the macro package to be doing this, but your patch makes its behavior more
consistent with what its intention appears to be; the original implementer
perhaps did not think about nroff mode, or didn't care, or this code dates
back to a time when the \n[.warn] values did not differ between the modes.

Interestingly, the `.nroff` and `.troff` requests do not affect `\n[.warn]`:


$ groff
.warn 1
.tm \n[.warn]
1
.nroff
.tm \n[.warn]
1
.troff
.tm \n[.warn]
1


As none of these are classical roff requests I suppose we can revisit the
issue of whether the above is good behavior.

Regarding starting sentences on new lines, that's fine material for a
different bug/patch.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57583>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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