bug-groff
[Top][All Lists]
Advanced

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

[bug #61853] [ms] XA does not suppress leader if given "no" argument


From: G. Branden Robinson
Subject: [bug #61853] [ms] XA does not suppress leader if given "no" argument
Date: Wed, 19 Jan 2022 02:36:46 -0500 (EST)
User-agent: Lynx/2.8.9rel.1 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/3.6.7

Follow-up Comment #2, bug #61853 (project groff):

I see now what the problem with the links was.  Newlines are not
allowed inside the brackets for a titled hyperlink.  That in
turn means that paragraph reflow is busted if you place your own
line breaks (which is necessary for sanity preservation while
using lynx).  These details are not mentioned in the utterly
perfunctory documentation of the syntax, which doesn't explain
how anything is parsed--it just throws the simplest possible
examples at the reader and leaves anyone with greater needs to
sink or swim.  What did I expect?  It's the Markdown
mentality--get something down and throw it over the wall.
Velocity.  Agile.  Kanban.  Move fast.  Break stuff.  Cash out.

Trying again:

Our documentation (in _groff_ms_(7) from Git HEAD) says:


       .XS [page-number]
       .XA [page-number [indentation]]
       .XE    Begin, supplement, and end a table of contents entry.
              Each entry is associated with page-number (otherwise the
              current page number); a page-number of "no" prevents a
              leader and page number from being emitted for that entry.
              Use of .XA within .XS/.XE is optional; it can be repeated.
              If indentation is present, a supplemental entry is
              indented by that amount; ens are assumed if no unit is
              indicated.  Text on input lines between .XS and .XE is
              stored for later recall by .PX.


Input:


$ cat EXPERIMENTS/toc-example.ms
.NH 1
Introduction
.XS
Introduction
.XE
.PP
Foo bar baz.
.NH 2
Methodology
.XS
        Methodology
.XA
                Fassbinder's Approach
.XA no
                        Charges of unethical conduct
.XA no
                        Aftermath
.XA
                Kahiu's Approach
.XE
.PP
Bar baz qux.
.NH 1
Findings
.XS
Findings
.XE
.PP
Baz qux foo.
.TC


Output:

$ nroff -Tascii -ms EXPERIMENTS/toc-example.ms | cat -s

1.  Introduction

     Foo bar baz.

1.1.  Methodology

     Bar baz qux.

2.  Findings

     Baz qux foo.

                             -i-

                     Table of Contents

Introduction . . . . . . . . . . . . . . . . . . . . . .   1
     Methodology . . . . . . . . . . . . . . . . . . . .   1
          Fassbinder's Approach  . . . . . . . . . . . .   1
               Charges of unethical conduct  . . . . . .
               Aftermath . . . . . . . . . . . . . . . .
          Kahiu's Approach . . . . . . . . . . . . . . .   1
Findings . . . . . . . . . . . . . . . . . . . . . . . .   1



Tuthill's _ms.diffs_ document
<https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/doc/msmacros/ms.diffs>
(4.2BSD) doesn't document the macro to the level of detail required to
decide the issue (in fact, it doesn't document the closely related `TC`
macro at all), so let's have a look at the
implementation
<https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/lib/ms/s.toc>.


. \" XA - add index entry
.de XA
.if !'\\*(XL'no' \\a\\t\\*(XL
.if \\n(.$ .ds XL \\$1
.sp \\n(PDu
.if \\n(.$-1 \{\
. nr XI 1
. in \\$2n
.\}
..


(I've changed the control character used for the delimiter in
the output comparison operator to a neutral apostrophe to make
it visible, and in _groff_ outside of compatibility mode, the
control-character contrivance is not necessary.)

The first line of the macro definition is what matters here.
`XA` does not put a copy-mode leader `\a` or tab `\t` or the
contents of the `XL` string (a formatted page number saved by
the `XS` macro) if `XA`'s first argument is "no".

So our implementation needs to change.  I'll look into this.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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