bugGNU roff - Bugs: bug #66219, [troff] explain interaction of...

 
 

bug #66219: [troff] explain interaction of diversions with line numbering and margin characters

Submitter:  Dave <barx>
Submitted:  Sun 15 Sep 2024 02:06:55 AM UTC
   
 
Category:  Core Severity:  2 - Minor
Item Group:  Documentation Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 17 Sep 2024 12:45:13 PM UTC, comment #1: 

I am put in mind of this.


commit cd6c3bacfd7c2bacafe4fa55e56c57983dc43d64
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Nov 29 09:08:39 2022 -0600

    NEWS: Add item regarding tbl and line numbering.

    $ cat ~/tmp/line-numbered-table.roff
    .nm 1
    Here is a line of output.
    Sic transit adispicing meatballs.
    Let's pad it out with more content to ensure the line breaks.
    .TS
    L.
    This is my table.
    There are many like it but this one is mine.
    T{
    My table is my best exhibit;
    I will guard it as I guard my life.
    Even as it requires multiple output lines for an entry.
    T}
    .TE
    What is the line number now?

    I defy anyone to defend this:

    Unix Version 7 on a SIMH PDP-11/45 (and Heirloom Doctools troff today):

      1 Here is a line of  output.   Sic  transit  adispicing  meatballs.
      2 Let's pad it out with more content to ensure the line breaks.
      6 This is my table.
      7 There are many like it but this one is mine.
      8
      9   3 My table is my best exhibit; I will guard it
     10   4 as  I  guard  my  life.  Even as it requires
     11   5 multiple output lines for an entry.
     12 What is the line number now?


G. Branden Robinson <gbranden>
Group administrator
Sun 15 Sep 2024 02:06:55 AM UTC, original submission:  

When line numbering is active, lines in a diversion are numbered when the diversion is defined rather than when it's output--even if it's never output at all.

This may be intentional (at least Heirloom troff works the same way), so I'm opening it as a documentation bug since it's counterintuitive.  I'm not convinced it's desirable, so it could arguably be considered a longstanding behavior bug, but I'm also not sure it's fixable in any reasonable way, given that a diversion stores formatted text.

$ cat number-lines.rf
.nf
.nm 1
Line 1
Line 2
.di xxx
Diverted line
.di
Line 3
Line 4
$ nroff number-lines.rf | cat -s
  1 Line 1
  2 Line 2
  4 Line 3
  5 Line 4


Dave <barx>
Group Member

 

(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 gbranden (Posted a comment)
  • -email is unavailable- added by barx (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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-10-14 gbranden SummaryLine numbering interacts unexpectedly with diversion definition [troff] explain interaction of diversions with line numbering and margin characters

    Back to the top

    Powered by Savane 3.14-79a4.
    Corresponding source code