[PATCH 27/42] xargs.1: overcome limited portability of \~

"G. Branden Robinson" <[email protected]> Tue, 18 Nov 2025 21:48:09 -0600
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <20251119034809.bqtydacfastil77b@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 8e345be9..eb679f2f 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
@@ -293,10 +295,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-----

iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmkdPfkACgkQ0Z6cfXEm
bc5aRhAAoH41Cozu55txSyhevQxb9EWp2I5kP1wuT0wVRpwpYWYEj++Qc8RzQyvA
+YG78B7nq8ALnZ8FWGpEqCKSf8+sOXp/16VuhOgeFQmofL84znLiQ7COxtdYsOUn
Db5FNRyFmPe42iCaLr1a+HL4mUN8LG8voFX4XMlpCW16Dr/wSaXNRVVN+QiYBOCo
UHjmHBo7Vx2FseVAxSBoiuQ2LHYKfz1ZLIKOVdpigA4OdBHmu+Lav2yw6/hM8QC6
gQDd17IMTZkDdG05Ct9reqA/sAGq+nj91a3JjCGiDX9askIeg/h3eafru7/sPScN
sR4hhatllyirDrLieMbAx6eDZIXy0zhSdm659PTn9ohqB3jCLLUEOsfhlEyGn7Yy
gD0FQIpPkudOH9eFGz+anKlM6Xk9H0Sz/BOuKw3fcxUMs3HL+W/pG67yXzh3e8HT
cP4IfRcbi6/x4LAF/y9haj77Q43sZ3gpy4Xj3IlM14x5vho6QPtPORUknJVLIz0l
n2LT4PfqW9A5EMG56gPDybtUxdmlw9Hrc8RWa+AiwNMguR4E6hGyeQGT89mOko2I
JyuOjeu4pT8c61ErR5soIcZZWNLdEKGa1IbKheR6MhIIZF2gCQjt0GroiDtGf6hm
24sRtfe19T160EK6HVqCcvXV3NRpfY09oc6/AKBoXsdrhwExwnM=
=wrZ2
-----END PGP SIGNATURE-----