bug-groff
[Top][All Lists]
Advanced

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

[bug #61646] [me] line numbering doesn't work as documented


From: G. Branden Robinson
Subject: [bug #61646] [me] line numbering doesn't work as documented
Date: Wed, 8 Dec 2021 19:39:24 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

URL:
  <https://savannah.gnu.org/bugs/?61646>

                 Summary: [me] line numbering doesn't work as documented
                 Project: GNU troff
            Submitted by: gbranden
            Submitted on: Thu 09 Dec 2021 12:39:22 AM UTC
                Category: Macro - me
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

Commit b69062693d
<https://git.savannah.gnu.org/cgit/groff.git/commit/?id=b69062693d3360efce9d4d63fac337be21e07db7>
is the bane of my existence.

Every thorny problem I have with tbl or the me(7) macros seems to lead back to
it.

A few issues to note here.

1. This 'c' option to .n2 is not part of 4.4BSD me(7) and should have been
documented as a groff extension; this would shed light on what was
characterized as "old" behavior.

2. It seems a bit late to say you want to alter the page offset of numbered
lines when you're turning numbering _off_ (which is what `n2` does when given
no arguments).

3. The page offset doesn't work documented anyway--the line number does NOT go
into the left margin.  Instead the whole paragraph is further indented.

4. Argument checking is incorrect.  It should be possible to pass an empty
first argument to 'n2' in case you want the default behavior except for the
page offset calculation change (which nevertheless doesn't work).

On the bright side, the output is equally wrong in both nroff and troff modes,
which is good because nroff mode (in groff me(7)) has a page offset of zero. 
A negative page offset is invalid and prompts warnings from GNU troff.

Probably what we should do is tell the user in meref.me that nroff documents
will need to set a page offset if they want to use the line numbering
feature.

Also this 'c' flag thing should perhaps move to the `n1` macro, which happily
doesn't already take any arguments to it would simplify argument processing
for `n2` which is already complex, and has multiple syntactical problems I
will document in an attachment (from a pending commit).

Output is from groff 1.22.4.

Input:


$ cat EXPERIMENTS/line-numbering.me 
.po 5n
.lp
This is an unindented paragraph to show the page offset.
.pp
.n1
Paragraph without
.b c
argument to
.b n2 .
Jackdaws love my big sphinx of quartz.
Jackdaws love my big sphinx of quartz.
Jackdaws love my big sphinx of quartz.
.n2
.pp
.n1
Paragraph with
.b c
argument to
.b n2 .
Jackdaws love my big sphinx of quartz.
Jackdaws love my big sphinx of quartz.
Jackdaws love my big sphinx of quartz.
.n2 "" c


Output (nroff, but as noted, troff output is practically identical, mutatis
mutandis font and output device line length differences).


$ nroff -me EXPERIMENTS/line-numbering.me | cat -s
Line 23 -- Bad .n2 value

     This is an unindented paragraph to show the page offset.

       1      Paragraph  without c argument to n2.  Jackdaws love
       2 my big sphinx of quartz.  Jackdaws love my big sphinx of
         quartz.  Jackdaws love my big sphinx of quartz.

           1      Paragraph with c argument to n2.  Jackdaws love
           2 my big sphinx  of  quartz.   Jackdaws  love  my  big
           3 sphinx  of  quartz.   Jackdaws love my big sphinx of
           4 quartz.





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 09 Dec 2021 12:39:22 AM UTC  Name: ca36685a.diff  Size: 2KiB   By:
gbranden

<http://savannah.gnu.org/bugs/download.php?file_id=52454>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61646>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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