[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/9] doc/bash.1: Stop manipulating adjustment.
From: |
G. Branden Robinson |
Subject: |
[PATCH 5/9] doc/bash.1: Stop manipulating adjustment. |
Date: |
Mon, 16 Dec 2024 11:48:12 -0600 |
Unfortunately, the *roff `ad` request doesn't work like everyone seems
to think it does. When invoked without an argument, it does not mean
"restore whatever the previous adjustment mode was before I invoked `na`
to turn off adjustment". Instead, it means "make sure lines are
adjusted regardless of the previous adjustment mode, unless that mode
was 'r' or 'c', in which case restore it." (These aren't, strictly
speaking, "adjustment" modes since modes 'c' and 'r' don't adjust the
widths of spaces.) No, this doesn't make any sense but it is
nevertheless how AT&T *roff behaved starting somewhere between Sixth and
Seventh Edition Unix, and GNU troff replicates the behavior.
Some devils at Murray Hill whispered into Joe Ossanna's ear and
persuaded him that the alignment of text (to the left, right, or center
of the output line) and the adjustment of spaces within that output line
were not separate concerns. Is this an instance of brain damage that
Ken Thompson brought back from his Berkeley sabbatical?
Solution:
Since AT&T troff also lacks a feature for hyphenless discretionary
breaks (groff's `\%`), recast a sentence, set the example `PATH` on its
own line, indent it as a sort of inline display, use the Ninth Edition
Unix/groff extension `EX/EE` to set it in a constant-width typeface if
possible, and break the line in a fortuitous place if it seems like it
would overrun.
For groff 1.25 (not the in-preparation 1.24), I plan to revise the
behavior of the `ad` request to do what most of its users seem
(reasonably) to expect, at the risk of angering expert users who knew
about the `.j` register[1] but refused to use it.
Here is a homework assignment for anyone inclined to argue with me.
$ nroff <<EOF
.ll 24n \" Short line length demonstrates adjustment.
This text is aligned and adjusted per the formatter's defaults.
.br
.na
This text is not adjusted.
.br
.ad
This is left-aligned, adjusted text.
.br
.ad c
This is centered text.
.br
.ad
Predict the alignment and adjustment of this text.
.br
.ad r
Now let's try right-alignment.
.br
.ad
Predict the alignment and adjustment of this text.
.pl \n(nlu
EOF
References:
1. https://lists.gnu.org/archive/html/groff/2024-06/msg00053.html
2. https://www.tuhs.org/pipermail/tuhs/2024-October/031012.html
3. https://savannah.gnu.org/bugs/?65954
[1] `.j` was a late addition to pre-Kernighan troff, appearing in
Seventh Edition Unix (1979) but documented not CSTR #54 (1976), the
Troff/Nroff User's Manual. Possibly it was contributed by hands
other than Ossanna's after his untimely death. I wonder if this was
done in realization of what a poor decision had been taken, a sort
of partial repentance for an auto-craniotomy.
---
doc/bash.1 | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/doc/bash.1 b/doc/bash.1
index 43c12b8d..2f0edf7d 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -2820,10 +2820,16 @@ .SS "Shell Variables"
The default path is system-dependent,
and is set by the administrator who installs
.BR bash .
-A common value is
-.na
-.Q /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin .
-.ad
+A common value follows.
+.RS
+.RS 5n
+.EX
+/usr/local/bin:/usr/local/sbin:\c
+.if \n(LL<78n .br
+/usr/bin:/usr/sbin:/bin:/sbin
+.EE
+.RE
+.RE
.TP
.B POSIXLY_CORRECT
If this variable is in the environment when \fBbash\fP starts, the shell
--
2.30.2
signature.asc
Description: PGP signature
- [PATCH 5/9] doc/bash.1: Stop manipulating adjustment.,
G. Branden Robinson <=