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

Path csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
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 Tue, 4 Feb 2020 17:32:56 -0500 (EST)
Lines 73
Approved bug-groff@gnu.org
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>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain;charset=UTF-8
X-Trace usenet.stanford.edu 1580855583 29109 209.51.188.17 (4 Feb 2020 22:33:03 GMT)
X-Complaints-To action@cs.stanford.edu
To "G. Branden Robinson" <g.branden.robinson@gmail.com>, Bjarni Ingi Gislason <bjarniig@rhi.hi.is>, Ingo Schwarze <schwarze@usta.de>, bug-groff@gnu.org
Envelope-to bug-groff@gnu.org
X-PHP-Originating-Script 1001:sendmail.php
X-Savane-Server savannah.gnu.org:443 [209.51.188.79]
X-Savane-Project groff
X-Savane-Tracker bugs
X-Savane-Item-ID 57583
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 PureBrowser/60.9.0
X-Apparently-From 1.129.105.184 (Savane authenticated user gbranden)
In-Reply-To <20200204-220421.sv93188.46040@savannah.gnu.org>
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From 209.51.188.79
X-BeenThere bug-groff@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id "Bug reports for the GNU version of nroff, troff et al" <bug-groff.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-groff>, <mailto:bug-groff-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-groff>
List-Post <mailto:bug-groff@gnu.org>
List-Help <mailto:bug-groff-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-groff>, <mailto:bug-groff-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <20200204-223256.sv108747.25653@savannah.gnu.org>
X-Mailman-Original-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>
Xref csiph.com gnu.groff.bug:1716

Show key headers only | 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