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:06:41 -0500 (EST)
User-agent: Lynx/2.8.9rel.1 libwww-FM/2.14 SSL-MM/1.4.1 GNUTLS/3.6.7

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

                 Summary: [ms] XA does not suppress leader if given "no"
argument
                 Project: GNU troff
            Submitted by: gbranden
            Submitted on: Wed 19 Jan 2022 07:06:39 AM UTC
                Category: Macro ms
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

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
[https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/doc/msmacros/ms.diffs
_ms.diffs_ document] (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
[https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/lib/ms/s.toc
implementation].


. \" 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]