[PATCH 24/40] xargs/xargs.1: Overcome limited portability of \~.

"G. Branden Robinson" <[email protected]> Thu, 13 Nov 2025 10:49:12 -0600
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <20251113164912.mfejtwwgxpcapgek@illithid>
Define a string to indirect use of `\~` escape sequence.  On formatters
that don't support groff extensions, use the AT&T troff `\ `
(backslash-space) escape sequence, which isn't quite as good because it
is a space that is not only unbreakable, but unadjustable--which,
however, doesn't matter when formatting man pages with adjustment
disabled, as some implementations do (and which groff makes
configurable).

groff_man_style(1):
   Portability
...
     \~        Adjustable non‐breaking space.  Use this escape sequence
               to prevent a break inside a short phrase or between a
               numerical quantity and its corresponding unit(s).

                      Before starting the motor,
                      set the output speed to\~1.
                      There are 1,024\~bytes in 1\~KiB.
                      CSTR\~#8 documents the B\~language.

               \~ is a GNU extension also supported by Heirloom Doctools
               troff 050915 (September 2005), mandoc 1.9.14
               (2009‐11‐16), neatroff (commit 1c6ab0f6e, 2016‐09‐13),
               and Plan 9 from User Space troff (commit 93f8143600,
               2022‐08‐12), but not by DWB or Solaris 10 troffs.

Fixes warnings from `groff -C -ww -man` in the forthcoming groff 1.24:
troff:xargs/xargs.1:295: warning: an escaped '~' is not portable to AT&T troff
troff:xargs/xargs.1:296: warning: an escaped '~' is not portable to AT&T troff
troff:xargs/xargs.1:296: warning: an escaped '~' is not portable to AT&T troff
troff:xargs/xargs.1:298: warning: an escaped '~' is not portable to AT&T troff
---
 xargs/xargs.1 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xargs/xargs.1 b/xargs/xargs.1
index aa7ef721..262da31e 100644
--- a/xargs/xargs.1
+++ b/xargs/xargs.1
@@ -1,9 +1,11 @@
 .TH XARGS 1 2024-06-03 findutils \" -*- nroff -*-
 .ie \n(.g \{\
 .  ds en \(en
+.  ds ~~ \~
 .\}
 .el \{\
 .  ds en \-
+.  ds ~~ \ \" backslash, space
 .\}
 .SH NAME
 xargs \- build and execute command lines from standard input
@@ -292,10 +294,10 @@ .SH OPTIONS
 the argument strings.
 The largest allowed value is system-dependent, and is calculated as the
 argument length limit for exec, less the size of your environment,
-less 2048\~bytes of headroom.
-If this value is more than 128\~KiB, 128\~KiB is used as the default value;
+less 2048\*(~~bytes of headroom.
+If this value is more than 128\*(~~KiB, 128\*(~~KiB is used as the default value;
 otherwise, the default value is the maximum.
-1\~KiB is 1024 bytes.
+1\*(~~KiB is 1024 bytes.
 .B xargs
 automatically adapts to tighter constraints.
 .TP
-- 
2.30.2
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmkWDAgACgkQ0Z6cfXEm
bc4sGA//ezG6RDRZZagaq7lfnX7VwmWUXMpgziRmhYYBsPsSurqlu8PKVYtX8YCg
/nZuDX7hdO7DKfzBvYhYL/IA0+pWRXMvRKtJl1hnAHqdjnteR6V0lVFkaM9XPMFn
Ds1cqOPBpbdsnd+4kFMRjD9F7KB25t6xxPIvefy1jDUT4PQcfF5Jv/yzm+SNP0lA
1vzJEgDIzIXoVCdkbCa60feva4sQJonTNTMdyfgc//CPxyS5Erdf7B0FOr59CjQN
DIz2WsDaWPwJLwP8fGn0solAg9eaS3jZcAmk11vg5+/I81YvR58h34rNMmsU0t+t
NRAaN6Mg4CzslIid5/zlqf9bB45kBLwwp8vWV2GsNZqxoDD6/fdbdv+PTKoQszmu
IY3OO0lVCeQ5urJOBa2e79Mo5PCbMHwwPAH96Byo7qiSskBDb4IpYYcUxfC4tfOO
xkuHjs7Arp4oYuUTqowEFH8XI5B4XChPz5YJe0OjEZFz7Si7gWfmgjZnTo2RSlq0
3hvoGhCJVQr/8eFoqDWgz4n6BjeeOVf/pcPuFlokggSrl2jvLEuSeAcTEgpAFB6Y
tm4Is2CTz1cLEGMkIdp60UiSgARd+k2uAYerZhW129lLgjQKrg2oXGcRt02JWxC+
57bl3HoqyTjhY8Vtdm1o9pN//f9xVwch/pgdzO8jNGBVQyRanHI=
=1sZA
-----END PGP SIGNATURE-----