Hi Paul,

I noticed the following commit to the tz repository today.

commit 82a3bd52f240533ecd7c27172a59d058b6f53ad0
Author:     Paul Eggert <egg...@cs.ucla.edu>
AuthorDate: Sun Aug 24 11:51:17 2025 -0700
Commit:     Paul Eggert <egg...@cs.ucla.edu>
CommitDate: Sun Aug 24 11:51:17 2025 -0700

    Fix adjustment and hyphenation in *.txt files

    * date.1: Remove no-longer-needed .nh and .na.
    * workman.sh: Modernize the code that disables adjustment and
    hyphenation, to work in groff 1.23 too.  Add comments.

I have a suggestion for accomplishing all of the tasks named in the
Subject with command-line options to (recent) nroff.  If I understand
the "workman.sh" script correctly, all that would be left for your
pipeline is to strip a trailing blank line.

You might find it more convenient to use command-line options than to
append to macro definitions and otherwise inject *roff into nroff's
input stream (which is interpreted only after the macro package is
loaded, a fact that will have important consequences in groff 1.24).

Here's a "nothing up my sleeve" demonstrator.  (This is mostly to keep
myself honest, since I live on my Git working copy of groff every day.)

$ ~/groff-1.23.0/bin/nroff -ww -d AD=l -r HY=0 -d PT='' -d BT='' -man \
  -P -cbou ./tzfile.5 | sed -n '1,10p;395,404p'
NAME
       tzfile - timezone information

DESCRIPTION
       The timezone information files used by tzset(3) are typically found
       under a directory with a name like /usr/share/zoneinfo.  These files
       use the format described in Internet RFC 9636.  Each file is a sequence
       of 8‐bit bytes.  In a file, a binary integer is represented by a
       sequence of one or more bytes in network order (bigendian, or high‐
       order byte first), with all bits significant, a signed binary integer
         •  Some readers mishandle UT offsets that are not a multiple of one
            hour, or of 15 minutes, or of 1 minute.

SEE ALSO
       time(2), localtime(3), tzset(3), tzselect(8), zdump(8), zic(8).

       Olson A, Eggert P, Murchison K. The Time Zone Information Format
       (TZif).  October 2024.  Internet RFC 9636 ⟨https://www.rfc‐editor.org/
       rfc/rfc9636⟩ doi:10.17487/RFC9636 ⟨https://doi.org/10.17487/RFC9636⟩.

I'll summarize what these options do.

-ww             Turns on all GNU troff warnings.  The tz pages provoke
                only two,[1] so you might want to add it to the
                "workman.sh" script as a sort of linter.

-d AD=l         Disables adjustment.  In the forthcoming groff 1.24,
                after much discussion[2] with podlators/pod2man guru
                Russ Allbery (and two years of pondering how to satisfy
                a constraint problem), you'll want to specify this
                option _at the command line_[3] to assert a "user
                preference".

-r HY=0         Disables automatic hyphenation.  As with the previous
                item, you'll want to specify this on the command line
                for groff 1.24.

-d PT=''        Defines an empty page header.

-d BT=''        Defines an empty page footer.

-man            Loads the "an.tmac" macro package.

-P -cbou        Passes the options "-cbou" to the postprocessor or
                output driver.  These grotty(1) options do the
                following.

        -c      Uses grotty's legacy output format.  SGR and OSC escape
                sequences are not emitted.

        -b      Suppresses the use of overstriking for bold characters
                in legacy output format.

        -o      Suppresses overstriking (other than for bold and/or
                underlined characters when the legacy output format is
                in use).

        -u      Suppresses the use of underlining for italic characters
                in legacy output format.

The result of the options to grotty(1) is that less(1) doesn't need its
`-R` option specified to page the document attractively.

All of these options are documented, but unfortunately not all in one
place due to groff's pipelined architecture.  You can find them
variously in groff(1) (`-P`), troff(1) (`-ww`), grotty(1) (`-cbou`), and
groff_man(7) (the rest).

I hope this information is useful!  Please tell me if it isn't.

Regards,
Branden

[1] $ for p in *.[0-9]; do ~/groff-1.23.0/bin/nroff -ww -d AD=l \
      -r HY=0 -d PT='' -d BT='' -man -P -cbou -z $p; done
troff:newstrftime.3:77: warning: macro 'Ql' not defined
troff:zic.8:352: warning: unbalanced 'el' request

The former is a bug in the page; `Ql` is an mdoc(7) macro, not man(7).

Here's a hand-written diff:

 A conversion specification consists of a percent sign
-.Ql %
+. RB \*(lq % \*(rq
 and one other character.

If you're no longer concerned about portability to old System V/DWB
troffs, you can simplify that.  The `lq` and `rq` strings are portable
to everything I know of except Plan 9 troff.[4]

 A conversion specification consists of a percent sign
-.Ql %
+. RB \[lq] % \[rq]
 and one other character.

The latter is a bug in groff.  It's fixed in the Git trunk and I expect
to ship it in groff 1.24.0.rc1.[5]

[2] https://savannah.gnu.org/bugs/?67363
[3] or in your "man.local" and/or "mdoc.local" site configuration files
[4] https://savannah.gnu.org/bugs/?67448#comment5
[5] https://savannah.gnu.org/bugs/?45502

Attachment: signature.asc
Description: PGP signature

Reply via email to