Update of bug #68124 (group groff):

                  Status:                    None => Invalid
             Assigned to:                    None => gbranden
             Open/Closed:                    Open => Closed
                 Summary: DS Macro difference between 1.22.4 and 1.24.0 =>
[mm] DS macro interprets 3rd argument in ens as of groff 1.24.0

    _______________________________________________________

Follow-up Comment #1:

[comment #0 original submission:]
> GROFF VERSOIN: 1.22.4 / 1.24.0
> PLATFORM:
> Linux roffmm 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun
> 5 18:30:46 UTC 2025 x86_64 GNU/Linux
> 
> Linux ... 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5
> 18:30:46 UTC 2025 x86_64 GNU/Linux
> 
> CONFIGURATOIN REPORT:
> DEBIAN:
> Package: groff
> Status: install ok installed
> Priority: optional
> Section: text
> Installed-Size: 10557
> Maintainer: Colin Watson <[email protected]>
> Architecture: amd64
> Multi-Arch: foreign
> Version: 1.22.4-10
> Provides: groff-x11, jgroff
> Depends: groff-base (= 1.22.4-10), libc6 (>= 2.35), libgcc-s1 (>= 3.0),
> libstdc++6 (>= 4.1.1), libx11-6, libxaw7 (>= 2:1.0.14), libxmu6 (>= 2:1.1.3),
> libxt6
> Recommends: ghostscript, imagemagick, libpaper1, netpbm, perl, psutils
> Conffiles:
> /etc/X11/app-defaults/GXditview ee0e9f38fdf99c32c77a89cd67b8ac03
> /etc/X11/app-defaults/GXditview-color 753a00fce7fa986c812c517b8bb2680e
> Description: GNU troff text-formatting system
> This package contains optional components of the GNU troff text-formatting
> system. The core package, groff-base, contains the traditional tools like
> troff, nroff, tbl, eqn, and pic. This package contains additional devices
> and drivers for output to DVI, HTML (when recommended packages are
> installed - see below), PDF, HP LaserJet printers, and Canon CAPSL LBP-4
> and LBP-8 printers.
> .
> The X75, X75-12, X100, and X100-12 devices, which allow groff output to be
> conveniently viewed on an X display using the standard X11 fonts, are now
> included here. They were previously in a separate package, groff-x11.
> .
> Besides these, the groff package contains man pages describing the language
> and its macro sets, info documentation, and a number of supplementary
> programs:
> .
> - gxditview, which is used to display the output of the X* devices, and
> can also be used to view PostScript output from groff;
> - grn, a preprocessor for pictures in the 'gremlin' format;
> - tfmtodit, which creates font files for use with 'groff -Tdvi';
> - hpftodit, which creates font files for use with 'groff -Tlj4';
> - afmtodit, which creates font files for use with 'groff -Tps';
> - refer, which preprocesses bibliographic references for use with groff;
> - indxbib, which creates inverted indices for bibliographic databases used
> by 'refer';
> - lkbib and lookbib, which search bibliographic databases;
> - addftinfo, which adds metric information to troff font files for use
> with groff;
> - pfbtops, which translates a PostScript font in .pfb format to ASCII for
> use with groff;
> - mmroff, a simple groff preprocessor which expands references in mm;
> - pic2graph, which converts PIC diagrams into cropped image files;
> - eqn2graph, which converts EQN equations into cropped image files;
> - pdfmom, which runs 'groff -mom' to produce PDFs.
> .
> All the standard macro packages are supported.
> .
> Some facilities only work if certain recommended packages are installed:
> .
> - ghostscript, netpbm, psutils: required for HTML output;
> - imagemagick: required for the pic2graph and eqn2graph programs;
> - libpaper1: paper size detection in dvi, lbp, lj4, and ps devices (falls
> back to a4 if not installed);
> - perl: required for PDF output and for the chem preprocessor.
> Homepage: https://www.gnu.org/software/groff/
> 
> ARCH:
> Repository      : core
> Name            : groff
> Version         : 1.24.0-1
> Description     : GNU troff text-formatting system
> Architecture    : x86_64
> URL             : https://www.gnu.org/software/groff/groff.html
> Licenses        : GPL-3.0-or-later
> Groups          : None
> Provides        : None
> Depends On      : glibc  libgcc  libstdc++  perl
> Optional Deps   : netpbm: for use together with man -H command interaction in
> browsers
> psutils: for use together with man -H command interaction in browsers
> libxaw: for gxditview
> perl-file-homedir: for use with glilypond
> Conflicts With  : None
> Replaces        : None
> Download Size   : 2.40 MiB
> Installed Size  : 9.01 MiB
> Packager        : Tobias Powalowski <[email protected]>
> Build Date      : Sun 01 Mar 2026 12:37:01 AM MST
> Validated By    : SHA-256 Sum  Signature
> 
> INPUT FILE:
> (attached)
> 
> COMMAND LINE:
> groff -mm -T pdf example.mm > x.y.z.pdf
> 
> DESCRIPTION:
> 
> I have attached 2 pdfs generated from 1.22.4 and 1.24.0. They were generated
> from (effectively) the same source (just changed the version number
> displayed). Both were generated using the same command.
> 
> It seems that the third argument in the .DS macro is doing something weird
> :/
> In the older version it would just intent the right-hand side (as the man
> page suggests it does) but in the newer version it tries to push the right
> margin all the way left, spitting out error messages such as:
> 
> troff:example.mm:5: warning [page 1, 1.5i (diversion 'ds*div!1', 0.0i)]:
> cannot adjust line; overset by 0.231514i
> 
> Where the older version has no errors and works as expected.

Thanks for the report.

I notice a few points about your example.


$ groff -ww -mm -z ./ATTIC/68124.mm
troff:./ATTIC/68124.mm:1: warning: name 'PP' not defined
troff:./ATTIC/68124.mm:4: warning: setting computed line length -124593000u to
device horizontal motion quantum
troff:./ATTIC/68124.mm:4: warning: setting computed title length -124593000u
to device horizontal motion quantum
troff:./ATTIC/68124.mm:5: warning [page 1, 1.5i (diversion 'ds*div!1', 0.0i)]:
cannot adjust line; overset by 0.231514i
troff:./ATTIC/68124.mm:5: warning [page 1, 1.5i (diversion 'ds*div!1', 0.2i)]:
cannot adjust line; overset by 0.208319i
troff:./ATTIC/68124.mm:5: warning [page 1, 1.5i (diversion 'ds*div!1', 0.3i)]:
cannot adjust line; overset by 0.092625i
troff:./ATTIC/68124.mm:5: warning [page 1, 1.5i (diversion 'ds*div!1', 0.5i)]:
cannot adjust line; overset by 0.478319i
troff:./ATTIC/68124.mm:5: warning [page 1, 1.5i (diversion 'ds*div!1', 0.7i)]:
cannot adjust line; overset by 0.138875i
troff:./ATTIC/68124.mm:5: warning [page 1, 1.5i (diversion 'ds*div!1', 0.8i)]:
cannot adjust line; overset by 0.246931i
troff:./ATTIC/68124.mm:5: warning [page 1, 1.5i (diversion 'ds*div!1', 1.0i)]:
cannot adjust line; overset by 0.277764i


As the _groff_mm_(7) man page says...


     Call an mm macro at the beginning of a document to initialize the
     package.  A simple mm document might use only P for paragraphing.


I therefore replaced the `PP` calls with `P`.

I also eliminated the blank lines per general guidance in _roff_(7) (and many
other resources like [https://vimhelp.org/syntax.txt.html#nroff _vim_(1)'s
":help nroff"] and
[https://commons.princeton.edu/motorcycledesign/wp-content/uploads/sites/70/2018/06/bell_labs_1368_001.pdf
Kernighan's paper "UNIX for Beginners"].

Next I made the document adaptable to any version of _groff_ by using built-in
registers to report the program's version number.

Finally, I added to the content of the first paragraph display so that the
location of the right margin can be easily seen even with _groff_ 1.22.4


$ cat ./ATTIC/68124gbr.mm
.P
This is an
.I mm
document formatted with
.I groff
\n[.x].\n[.y].\n[.Y].
Ut enim ad minima veniam,
quis nostrum exercitationem ullam corporis suscipitlaboriosam,
nisi ut aliquid ex ea commodi consequatur?
.DS I F \n[Si]
Here's a display that is indented on both sides.
Sed ut perspiciatis,
unde omnis iste natus error
sit voluptatem accusantium doloremque laudantium,
totam rem aperiam eaque ipsa,
quae ab illo inventore veritatis
et quasi architecto beatae vitae dicta sunt,
explicabo.
.DE
.P
Goodbye!


I get the same results with _groff_ 1.22.4 and _groff_ 1.23.0.

I can also reproduce it in _nroff_ mode, which is less unwieldy to work with
than PostScript attachments.


troff:./ATTIC/68124gbr.mm:10: warning: setting computed line length -1560u to
device horizontal motion quantum
troff:./ATTIC/68124gbr.mm:10: warning: setting computed title length -1560u to
device horizontal motion quantum
troff:./ATTIC/68124gbr.mm:11: warning [page 1, line 12, diversion 'ds*div!1',
line 1]: cannot adjust line; overset by 5n
troff:./ATTIC/68124gbr.mm:11: warning [page 1, line 12, diversion 'ds*div!1',
line 3]: cannot adjust line; overset by 6n
troff:./ATTIC/68124gbr.mm:11: warning [page 1, line 12, diversion 'ds*div!1',
line 4]: cannot adjust line; overset by 3n
troff:./ATTIC/68124gbr.mm:11: warning [page 1, line 12, diversion 'ds*div!1',
line 5]: cannot adjust line; overset by 1n
troff:./ATTIC/68124gbr.mm:11: warning [page 1, line 12, diversion 'ds*div!1',
line 6]: cannot adjust line; overset by 7n
troff:./ATTIC/68124gbr.mm:11: warning [page 1, line 12, diversion 'ds*div!1',
line 7]: cannot adjust line; overset by 1n
troff:./ATTIC/68124gbr.mm:11: warning [page 1, line 12, diversion 'ds*div!1',
line 8]: cannot adjust line; overset by 3n
troff:./ATTIC/68124gbr.mm:11: warning [page 1, line 12, diversion 'ds*div!1',
line 9]: cannot adjust line; overset by 5n
troff:./ATTIC/68124gbr.mm:12: warning [page 1, line 12, diversion 'ds*div!1',
line 10]: cannot adjust line; overset by 2n
troff:./ATTIC/68124gbr.mm:12: warning [page 1, line 12, diversion 'ds*div!1',
line 11]: cannot adjust line; overset by 1n
troff:./ATTIC/68124gbr.mm:12: warning [page 1, line 12, diversion 'ds*div!1',
line 12]: cannot adjust line; overset by 12n
troff:./ATTIC/68124gbr.mm:13: warning [page 1, line 12, diversion 'ds*div!1',
line 13]: cannot adjust line; overset by 3n
troff:./ATTIC/68124gbr.mm:13: warning [page 1, line 12, diversion 'ds*div!1',
line 14]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:13: warning [page 1, line 12, diversion 'ds*div!1',
line 15]: cannot adjust line; overset by 3n
troff:./ATTIC/68124gbr.mm:13: warning [page 1, line 12, diversion 'ds*div!1',
line 16]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:13: warning [page 1, line 12, diversion 'ds*div!1',
line 17]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:14: warning [page 1, line 12, diversion 'ds*div!1',
line 18]: cannot adjust line; overset by 2n
troff:./ATTIC/68124gbr.mm:14: warning [page 1, line 12, diversion 'ds*div!1',
line 19]: cannot adjust line; overset by 9n
troff:./ATTIC/68124gbr.mm:14: warning [page 1, line 12, diversion 'ds*div!1',
line 20]: cannot adjust line; overset by 10n
troff:./ATTIC/68124gbr.mm:14: warning [page 1, line 12, diversion 'ds*div!1',
line 21]: cannot adjust line; overset by 9n
troff:./ATTIC/68124gbr.mm:14: warning [page 1, line 12, diversion 'ds*div!1',
line 22]: cannot adjust line; overset by 10n
troff:./ATTIC/68124gbr.mm:15: warning [page 1, line 12, diversion 'ds*div!1',
line 23]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:15: warning [page 1, line 12, diversion 'ds*div!1',
line 24]: cannot adjust line; overset by 2n
troff:./ATTIC/68124gbr.mm:15: warning [page 1, line 12, diversion 'ds*div!1',
line 25]: cannot adjust line; overset by 6n
troff:./ATTIC/68124gbr.mm:15: warning [page 1, line 12, diversion 'ds*div!1',
line 26]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:15: warning [page 1, line 12, diversion 'ds*div!1',
line 27]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:16: warning [page 1, line 12, diversion 'ds*div!1',
line 28]: cannot adjust line; overset by 3n
troff:./ATTIC/68124gbr.mm:16: warning [page 1, line 12, diversion 'ds*div!1',
line 29]: cannot adjust line; overset by 1n
troff:./ATTIC/68124gbr.mm:16: warning [page 1, line 12, diversion 'ds*div!1',
line 30]: cannot adjust line; overset by 3n
troff:./ATTIC/68124gbr.mm:16: warning [page 1, line 12, diversion 'ds*div!1',
line 31]: cannot adjust line; overset by 8n
troff:./ATTIC/68124gbr.mm:16: warning [page 1, line 12, diversion 'ds*div!1',
line 32]: cannot adjust line; overset by 8n
troff:./ATTIC/68124gbr.mm:17: warning [page 1, line 12, diversion 'ds*div!1',
line 33]: cannot adjust line; overset by 1n
troff:./ATTIC/68124gbr.mm:17: warning [page 1, line 12, diversion 'ds*div!1',
line 34]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:17: warning [page 1, line 12, diversion 'ds*div!1',
line 35]: cannot adjust line; overset by 9n
troff:./ATTIC/68124gbr.mm:17: warning [page 1, line 12, diversion 'ds*div!1',
line 36]: cannot adjust line; overset by 5n
troff:./ATTIC/68124gbr.mm:17: warning [page 1, line 12, diversion 'ds*div!1',
line 37]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:17: warning [page 1, line 12, diversion 'ds*div!1',
line 38]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:17: warning [page 1, line 12, diversion 'ds*div!1',
line 39]: cannot adjust line; overset by 4n
troff:./ATTIC/68124gbr.mm:18: warning [page 1, line 12, diversion 'ds*div!1',
line 40]: cannot adjust line; overset by 9n

                                   ‐ 1 ‐

       This is an mm document formatted with groff 1.24.0.  Ut enim
       ad minima veniam, quis nostrum exercitationem ullam corporis
       suscipitlaboriosam,   nisi   ut   aliquid   ex   ea  commodi
       consequatur?

            Here’s
            a
            display
            that
            is
            indented
            on
            both
            sides.
            Sed
            ut
            perspiciatis,
            unde
            omnis
            iste
            natus
            error
            sit
            voluptatem
            accusantium
            doloremque
            laudantium,
            totam
            rem
            aperiam
            eaque
            ipsa,
            quae
            ab
            illo
            inventore
            veritatis
            et
            quasi
            architecto
            beatae
            vitae
            dicta
            sunt,
            explicabo.

       Goodbye!



It looks like you have encountered a deliberate feature change in _groff mm_.

[https://cgit.git.savannah.gnu.org/cgit/groff.git/tree/NEWS?h=1.24.0#n643
NEWS]:

*  The m (mm) macro package's `DS` macro now interprets its third
   argument (a right-hand indentation) in ens by default, for
   consistency with the rest of the package.  This is a difference from
   DWB mm (which passed the value unprocessed to the `ll` request, which
   itself uses ems), and groff mm's own historical behavior, which used
   basic units.


Consequently the value of the `Si` register, which is stored in basic units
like all registers (where dimensioning is meaningful at all), needs to be
suffixed with "u" when interpolated, so that the _mm_ package recognizes it
using the correct units.

Here's a fix to your example document.


$ diff -u ./ATTIC/68124gbr{,2}.mm
--- ./ATTIC/68124gbr.mm 2026-03-05 15:01:17.394096538 -0600
+++ ./ATTIC/68124gbr2.mm        2026-03-05 15:08:21.172700515 -0600
@@ -4,7 +4,7 @@
 document formatted with
 .I groff
 \n[.x].\n[.y].\n[.Y].
-.DS I F \n[Si]
+.DS I F \n[Si]u
 Here's a display that is indented on both sides.
 Sed ut perspiciatis,
 unde omnis iste natus error


Here is the result.


$ nroff -ww -mm ./ATTIC/68124gbr2.mm | cat -s

                                   ‐ 1 ‐

       This is an mm document formatted with groff 1.24.0.  Ut enim
       ad minima veniam, quis nostrum exercitationem ullam corporis
       suscipitlaboriosam,   nisi   ut   aliquid   ex   ea  commodi
       consequatur?

            Here’s a display that is indented on  both  sides.
            Sed  ut  perspiciatis, unde omnis iste natus error
            sit voluptatem accusantium doloremque  laudantium,
            totam   rem  aperiam  eaque  ipsa,  quae  ab  illo
            inventore veritatis  et  quasi  architecto  beatae
            vitae dicta sunt, explicabo.

       Goodbye!



Since this was a deliberate change, I am closing this report as invalid.
Nevertheless, I welcome your feedback on this and any other issues you
encounter.

Thanks for putting the new _groff_ release to the test so quickly!


    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to