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

                 Summary: [man] should warn when sectioning macros used while
input trap pending
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Fri 24 Apr 2026 08:21:38 PM UTC
                Category: Macro package man
                Severity: 3 - Normal
              Item Group: Warning/Suspicious behaviour
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Unlocked
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 24 Apr 2026 08:21:38 PM UTC By: G. Branden Robinson <gbranden>
Thanks to Vincent Lefévre and bug #68271, I happened across an
eyebrow-raising usage of _man_(7) in the good old _fvwm-config_(1) document.


$ nl -ba /tmp/fvwm-config.1.in|sed -n '103,120p'
   103  .TP
   104  .BI --supports- <feature>
   105  prints nothing, returns: 0 if the
   106  .I <feature>
   107  is supported, 100 if not, 200 if unknown.
   108  All or supported feature names may be found using
   109  .IR --info " or " --supports
   110  respectively.
   111  .TP
   112  .SH USAGE
   113  Here are some real life usages.
   114
   115  Checks for xft support:
   116  .EX
   117  if fvwm-config --supports-xft;
   118    then echo 1; else echo 0; fi
   119  .EE
   120


Using a sectioning macro while an input trap is pending is not well-defined.

This input does not behave consistently across *roffs.

Plan 9 from User Space _troff_ truncates most of the rest of the document.


$ 9 nroff -man /tmp/fvwm-config.1.in | sed -n '/prints nothing,/,$p' | cat -s
               prints nothing, returns: 0 if the <feature> is sup-
               ported, 100 if not, 200 if unknown.  All or supported
               feature names may be found using --info or --supports
               respectively.

          Mikhael Goikhman <[email protected]>

     Page 2                        Fvwm              (printed 4/24/26)


DWB 3.3 _troff_ ignores the text of the section heading, but seems otherwise
to muddle through.


$ dwb nroff -man /tmp/fvwm-config.1.in | sed -n '/prints nothing,/,$p' | cat
-s | head
                 prints nothing, returns: 0 if the <feature> is sup-
                 ported, 100 if not, 200 if unknown.  All or supported
                 feature names may be found using --info or --supports
                 respectively.

            Here are some real life usages.

            Checks for xft support:

                 if fvwm-config --supports-xft;


Solaris 10 _troff_ is as DWB, modulus a different default indentation (and/or
page offset) in its _man_ package.


$ solaris10 nroff -man /tmp/fvwm-config.1.in | sed -n '/prints nothing,/,$p' |
cat -s | head
          prints nothing, returns: 0 if  the  <feature>  is  sup-
          ported,  100  if not, 200 if unknown.  All or supported
          feature names may be found using --info  or  --supports
          respectively.

     Here are some real life usages.

     Checks for xft support:

          if fvwm-config --supports-xft;


Heirloom Doctools _troff_ appears to ignore/cancel the pending input trap
planted by `TP` when it encounters `SH`.


$ heirloom nroff -man /tmp/fvwm-config.1.in | sed -n '/prints nothing,/,$p' |
cat -s | head
              prints nothing, returns: 0 if the <feature> is supported, 100
if
              not, 200 if unknown.  All or supported feature names may be
              found using --info or --supports respectively.

USAGE
       Here are some real life usages.

       Checks for xft support:

            if fvwm-config --supports-xft;


_groff_ 1.22.3, on the other hand interprets a fusion of `TP` and `SH`,
setting `SH`'s argument as a paragraph tag but also in bold.


$ ~/groff-1.22.3/bin/nroff -man /tmp/fvwm-config.1.in | sed -n '/prints
nothing,/,$p' | cat -s | head
              prints nothing, returns: 0 if the <feature> is supported, 100
if
              not,  200  if  unknown.   All  or supported feature names may
be
              found using --info or --supports respectively.

       USAGE  Here are some real life usages.

              Checks for xft support:
              if fvwm-config --supports-xft;
                then echo 1; else echo 0; fi



_groff_ 1.22.4 and 1.23.0 behave as 1.22.3.  _groff_ 1.24.0 and .1
additionally break the line after this hybrid heading-tag.


$ ~/groff-1.24.0/bin/nroff -man /tmp/fvwm-config.1.in | sed -n
'/prints[[:space:]]\+nothing,/,$p' | cat -s | head
            prints  nothing,  returns:  0  if the <feature> is supported, 100
if
            not, 200 if unknown.  All or supported feature names  may  be
found
            using ‐‐info or ‐‐supports respectively.

     USAGE
            Here are some real life usages.

            Checks for xft support:

                 if fvwm‐config ‐‐supports‐xft;


And, for fun, using the Seventh Edition Unix _man_(7) macros with _groff_
1.24.1 in compatibility mode yields the following.


$ nroff -C -M HISTORY/MAN/1979-01-v7 -manv7 /tmp/fvwm-config.1.in | sed -n
'/prints[[:space:]]\+nothing,/,$p' | cat -s | head -n 12
          prints nothing, returns: 0 if the <feature> is sup‐
          ported, 100 if not, 200 if unknown.  All or supported
          feature names may be found using ‐‐info or ‐‐supports
          respectively.

     Here are some real life usages.

Printed 4/24/126                                      RELDATELONG

fvwm‐config(1)       UNIX Programmer’s Manual      fvwm‐config(1)

     Checks for xft support:


So I guess Solaris 10 and DWB 3.3 _troff_ take the bug compatibility prize.
Not a surprise given the provenance of their copies of the macro package.







    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to