groff
[Top][All Lists]
Advanced

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

Re: [Groff] Unintended impact of strip.sed on om.tmac-u?


From: Ingo Schwarze
Subject: Re: [Groff] Unintended impact of strip.sed on om.tmac-u?
Date: Wed, 8 Nov 2017 16:16:55 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

Hi,

Peter Schaffter wrote on Tue, Nov 07, 2017 at 03:26:59PM -0500:
> On Tue, Nov 07, 2017, G. Branden Robinson wrote:

>> I've been inspecting the operation of tmac/strip.sed, and
>> 
>> I noticed that the following substitution:
>> 
>>   s/\([^/]\)doc-/\1/g
>> 
>> has an impact outside what I presume is its intension to shorten mdoc
>> symbol names.  It also does this:
>> 
>> diff -urN STOCK/om.tmac HACKED2/om.tmac
>> --- STOCK/om.tmac       2017-11-07 13:00:57.786695535 -0500
>> +++ HACKED2/om.tmac     2017-11-07 13:13:43.424234377 -0500
>> @@ -5178,7 +5178,7 @@
>>  .ds cover-type \\$0
>>  .substring cover-type 0 2
>>  .ie '\\*[cover-type]'COV' .ds cover-type cover
>> -.el .ds cover-type cover
>> +.el .ds cover-type doc-cover
>>  .tm1 "[mom]: \\$0 at line \\n[.c] of '\\n[.F]' is no longer valid.
>>  .tm1 "       Leading of \\*[cover-type] MISC items is now set with 
>> \\*[replacement], which
>>  .tm1 "       takes an absolute leading value.  Please update your document.
>> 
>> ...which makes the conditional a no-op.
>> 
>> All of the other substitutions in strip.sed are agnostic about symbol
>> names, and work only at the syntactical level.
>> 
>> Maybe mdoc should get its own sed one-liner that runs separately from
>> strip.sed?
>> 
>> I think that would be cheaper than expecting all future contributors to
>> groff to remember not to name any strings or macros doc-whatever if they
>> want their macro packages stripped.

> Even though only om.tmac is affected, and there only in a macro
> whose sole function is to emit a warning, I'm inclined to agree.
> strip.sed should remove comments and indentation but otherwise make
> no changes in the file.  mdoc needs to be treated as an exception.

Given that Werner argued that stripping is relevant because
not all roff documents using macro sets are manual pages
and that stripping is less important for manual pages because
well-written manuals pages never use loops (which i fully agree
with), i think the best solution would be to stop stripping
mdoc.  I already did measurements two years ago and found no
examples of manual pages where the time economy exceeds 20%.

Even if you want to keep stripping mdoc for some reason, you should
probably just stop stripping the doc- prefix.  I don't think setting
up dedicated machinery just for mdoc is worth the complexity.

Yours,
  Ingo



reply via email to

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