Source-Changes-D archive

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

Re: CVS commit: src/share/tmac



Robert Elz wrote in <18872.1577152009%jinx.noi.kre.to@localhost>:
 |    Date:        Mon, 23 Dec 2019 23:45:34 +0100
 |    From:        Steffen Nurpmeso <steffen%sdaoden.eu@localhost>
 |    Message-ID:  <20191223224534.8UFgy%steffen%sdaoden.eu@localhost>
 |
 |
 |||Troff reads .ie and checks the condition.  The condition is true and
 |||so the rest of the line is executed.  Then troff reads .el that
 |||matches successful .ie, so the .el is discarded.
 |||
 |||Then it reads .el which is not matched with any .ie that troff has
 |||seen.  It's usually silently discarded,
 |
 |That is what is (always was) intended to happen.
 |
 |||but since we run with -ww we
 |||get the warning about an unbalanced .el
 |
 |That's a broken warning.   The code in a "discarded" .el needs to be
 |examined anyway (if it weren't, the \{ \} block to group the code
 |together wouldn't work, and when doing that, it can easily notice an
 |embedded .ie (it must be immediately after the .el so looking for it is
 |not hard) which will require another matching .el, and make sure that
 |things are correctly balanced.   That would be a useful wraning.
 |
 |The
 | .ie
 | .el .ie
 | .el .ie
 | .el
 |
 |idiom has been used in troff (including by troff's authors) forever.

Forever, me too.  It is the very first groff commit of James Clark
which added that behaviour (1991-06-02 04:20:34 -0500).  Other
than that i do not think it is a broken warning, my mailer for
example simply bails with error if the if conditional stack is
empty, so broken is possibly that the warning only happens with
-w, and not by default. 

 |Deciding to make that improper now, just because someone who doesn't
 |understand, or cannot work out how to handle it correctly, is absurd.
 |
 |Perhaps (originally) the ".el .ie" combination could have been made
 |a macro of its own, it should really be treated as if it were (like
 |the "elif" word in sh), but adding more code to process another macro,
 |just to save (what would be) 3 input bytes per use wouldn't really
 |have been justifiable.

Maybe the warning should really simply be removed, or only occur
if explicitly requested, i.e., remove the "el" warning bit from
the "all" level, just as is already done for some others; i guess
that would be the best.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Home | Main Index | Thread Index | Old Index