Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.groff.bug > #1716

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

From "G. Branden Robinson" <INVALID.NOREPLY@gnu.org>
Newsgroups gnu.groff.bug
Subject [bug #57583] [PATCH] s.tmac: Test the default number for warnings for nroff
Date 2020-02-04 17:32 -0500
Message-ID <mailman.304.1580855583.2412.bug-groff@gnu.org> (permalink)
References <20200112-081117.sv93188.50403@savannah.gnu.org> <20200204-074740.sv108747.85719@savannah.gnu.org> <20200204-140242.sv97361.94849@savannah.gnu.org> <20200204-220421.sv93188.46040@savannah.gnu.org> <20200204-223256.sv108747.25653@savannah.gnu.org>

Show all headers | View raw


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/

Back to gnu.groff.bug | Previous | Next | Find similar


Thread

[bug #57583] [PATCH] s.tmac: Test the default number for warnings for nroff "G. Branden Robinson" <INVALID.NOREPLY@gnu.org> - 2020-02-04 17:32 -0500

csiph-web