[tex-k] Misplaced 'end' for 'endcases' in tex.web source code of 2014.

Shuo Chen giantchen at gmail.com
Sat Dec 14 01:02:30 CET 2019

Dear TeX maintainers,

In section 10 of 2014 Jan version of tex.web, on page 6, it says a
'case' statement
should end with the 'endcases' keyword in the WEB source code. But I
noticed that
some 'case' statements end with 'end' keyword instead.

This is not a bug of the TeX program per se. Because 'endcases' is
replaced with 'end'
by the tangle program by default. However, I think it might be worth
to update the
pretty-printing version of the program for consistency.

Here's one example, with Linux shell:

$ diff -U 8 tex.web tex2.web | head -15
--- tex.web    2019-09-09 14:16:36.022037462 -0700
+++ tex2.web    2019-12-13 09:39:24.865189980 -0800
@@ -1951,17 +1951,17 @@
 @<Change the interaction...@>=
 begin error_count:=0; interaction:=batch_mode+c-"Q";
 print("OK, entering ");
 case c of
 "Q":begin print_esc("batchmode"); decr(selector);
-end; {there are no other cases}
+endcases; {there are no other cases}
 print("..."); print_ln; update_terminal; return;

There are about two dozens such cases, see full diff output:

With this update, the tangled tex.p source file is not affected, only
the weaved tex.pdf changes a tiny bit.
See example of page 75: https://ibb.co/tqDjdBT

Also, there are some trailing spaces in tex.web, which can be found
with 'grep -n ' $' tex.web' on Linux.

Shuo Chen

More information about the tex-k mailing list