bugGNU roff - Bugs: bug #59384, ms: doesn't warn about repeated...

 
 

bug #59384: ms: doesn't warn about repeated .TL macros as it should

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Fri 30 Oct 2020 12:12:47 PM UTC
   
 
Category:  Macro ms Severity:  2 - Minor
Item Group:  Warning/Suspicious behaviour Status:  Invalid
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 28 Dec 2020 02:40:09 AM UTC, comment #2: 

Thanks for finding the reason for current groff ms behavior, Bjarni!

I looked into V7 Unix ms and found the following as part of the "BG" macro, which is called by a few body text macros including "RT" (reset) which is in turn called by the sectioning and paragraphing macros.


.de TL
.ft 3
.sp
.if n .ul 100
.ce 100
.LG
\\..
.de AU
.ft 2
.if n .ul 0
.ce 100
.sp
.NL
\\..
.de AI
.ft 1
.ce 100
.if n .ul 0
.if n .sp
.if t .sp .5
.NL
\\..


The above is revealing in two ways.  First, it shows that in AT&T ms, you could abuse .TL as a sort of sectioning macro--but secondly, that you could also do the same with the author name (AU) and institution (AI) macros!

...and sure enough, groff ms supports this (ab)use of AU and AI as well, in a compatible way, without warnings.

To get the error identified in the original report, .TL has to be used multiple times prior to a paragraph or sectioning macro.


.TL
Document Title
.TL
Document Title #2
.PP
This is my paragraph.


I therefore conclude that this is deliberate behavior and am resolving the ticket.

I am mulling over whether and how to document this oddity of TL, AI, and AU in our ms documentation.

G. Branden Robinson <gbranden>
Group administrator
Fri 25 Dec 2020 06:53:41 PM UTC, comment #1: 

  The .PP macro uses "cov*ab-init", which redefines ".TL" with

.als TL par@TL

Bjarni Ingi Gislason <bjarniig>
Fri 30 Oct 2020 12:12:47 PM UTC, original submission:  

The source code says this:


.de TL
.br
.als TL cov*err-not-again
.rn @AB AB
.rn @AU AU
.rn @AI AI
.di cov*tl-div
.par@reset
.ft B
.ps +2
.vs +3p
.ll (u;\\n[LL]*5/6)
.nr cov*n-au 0
.DEVTAG-TL
..


You would therefore think that a document like this would provoke the 'cov*err-not-again' macro:


.PP
First paragraph.
.TL
A Title
.PP
Next paragraph.
.TL
Another Title
.PP
Third paragraph.
.TL
Third Title
.PP
Fourth paragraph.


...but this renders without warnings.  Any user stumbling across this might be tempted to abuse .TL as a sort of sectioning macro.

AT&T ms behavior should be checked.

G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bjarniig (Posted a comment)
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-12-28 gbranden StatusNone Invalid
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code