groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Support 2-digit \sNN only in compatibility mode.


From: G. Branden Robinson
Subject: [PATCH] Support 2-digit \sNN only in compatibility mode.
Date: Wed, 1 Apr 2020 04:12:17 +1100
User-agent: NeoMutt/20180716

It was shockingly easy to implement my proposal of de-compatifying the
special logic that historical troff used to support two digits in the
single-digit form of the point-size escape.

But not so surprising in hindsight.  When you're heaping conditionals
this high in your recursive-descent parser, it is a sign that you are
headed the wrong direction, and making the syntax too hard to hold in
the head.

The heart of the change is merely this:

-    if (!inc && c != '0' && c < '4') {
+    if (compatible_flag && !inc && c != '0' && c < '4') {

The rest is commentary, documentation, and regression testing.

Why should we do this?  For those who haven't been following the sudden
burst of activity on the groff list, AT&T troff supported this weirdness
because...

the Graphic Systems C/A/T phototypesetter (the original device target
for AT&T troff) only supported a few discrete point sizes in the range
6..36.  Kernighan warned of this in the 1992 revision of CSTR #54, and
more recently, McIlroy referred to it as a "living fossil".  This DWIM
syntax is surprising to the user; it clashes with the syntax of several
other escapes (\*, \$, \f, \F, \g, \k, \m, \M, \n, \V, and \Y).  We
therefore support it only in compatibility mode.

The above also appears in a source code comment.

If I go forward with this, I'll add substantially the same material to
ChangeLog and NEWS.

This patch is not an April Fools' joke.  I mean it.  Let's fight!  :-P

Regards,
Branden

Attachment: 0001-Support-2-digit-sNN-only-in-compatibility-mode.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]