Re: Proposed: compatibility break: do nothing on `dt` request syntax error

"G. Branden Robinson" <[email protected]> Wed, 15 Apr 2026 08:10:34 -0500
Newsgroups gmane.comp.printing.groff.general
Message-ID <20260415131034.ak5r6zajs5xlkjfa@illithid>
[self-follow-up]

Yup, forgot the attachment.  Take a drink.

At 2026-04-15T07:57:31-0500, G. Branden Robinson wrote:
[snip]
> Naturally I'll have an automated test for this behavior.  I was
> writing one for the `dt` request (attached), and a piece of control
> flow puzzled me, and that's how I came to discover this issue.
[snip]

Regards,
Branden
dt-request-works.sh (application/x-sh, 1.5 KB)
#!/bin/sh
#
# Copyright 2026 G. Branden Robinson
#
# This file is part of groff, the GNU roff typesetting system.
#
# groff is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# groff is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

groff="${abs_top_builddir:-.}/test-groff"

fail=

wail () {
   echo "...FAILED"
   fail=yes
}

# Unit-test `dt` request.

# Test trap planting.

input='.
.de TT
BOING
.br
..
.di DD
.dt 3v TT
.nf
foo
bar
.sp
qux
.di
.DD
.'

output=$(printf '%s\n' "$input" | "$groff" -a 2>/dev/null)
echo "$output"
output=$(echo $output) # condense onto one line
echo "$output" | grep -q "bar BOING qux" || wail

# Test trap removal.

input2='.
.de TT
WHOOPS
.br
..
.di DD
.dt 3v TT
.nf
foo
bar
.dt
.sp
baz
.di
.DD
.'

output2=$(printf '%s\n' "$input2" | "$groff" -a 2>/dev/null)
echo "$output2"
output2=$(echo $output2) # condense onto one line
echo "$output2" | grep -q "foo bar baz" || wail

test -z "$fail"

# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmnfjkMACgkQ0Z6cfXEm
bc7XWhAAjq/oQTjnpazUKF4BUygtovvqp3uVI7yXWR7GDHVJcxAJHF4bGamu+NkE
6QW2y6FnakC7Q0JU4XyrOWHtQD/fAM6UtYlHHoCzqZv/bnnZ4b6f/6HcteCaCBEB
d7/M/9azdXC40+7gOoYaAapBznGbRGcZkB5gYK2sKBVxvt8l6AA9hBpwJqI5vzBn
jEi+wnZo6zgD9XfnxpfG4mKucGd090S8R2pPNWi/qS8P+ACEHMTjMBXqQRmxQjC3
GVRdjAOSqwC2syPgsu9VzIA4lyYIY4kmGUXg3e1vz3d1dX4TN8LBlHoNu14Xs/L4
/fR9Swipgcw6umR347smhY60FBi8Rmu6FsCGbOt/CBqD/AS9XKBiCU/DTWe4wns4
j7OM81U/8OHJ+3CauQB7ch34Lc2wN5F5owEMILyfZFLj7yZR71EJVSk4DQcYqzI2
miEytPJAB6qCiYbCsSqrvvPJAyiucUEb+TOc4062+kP0sWNXCAwsTr448FntTf0A
4Nq46Ay01ItfZDesb1BfZK9ZaJ1HCNl+Qsih86mQPv54zYR4fjl8FBGX+6X+Y47G
pEJ/7tEWu/pq2A+uGJRYVhoi1oQTbx6L2fiYDdPuGHdWi0SYkP4XdawFv+JpJrsK
i7EU6Z4r5yJuijJMpj1YpWulCUYYO0NiQ9nmkdJSI/99msoGN/U=
=iUla
-----END PGP SIGNATURE-----