Skip to content

Commit ec6dcad

Browse files
committed
Tuneup for CWEB 4.10.
Preparation: * Fix a bug in 'twinxmac.tex' (3rd patch file applied in 'cwebbin.spec') * Apply a 5th patch file to adapt CTWILL macros to CWEB 4.9/4.10 Special formatting: * Format 'common.w' with CTWILL using 'comm-mini.ch' * Format 'ctwill.w' with HiTeX using 'proofmac.tex' and 'ctwill-hint.ch' * New 'pdfproofmac.tex' for use with HiTeX and pdfTeX and XeTeX - pdfctwimac.tex will no longer work with HiTeX * Add 'proofsort' script in addition to 'refsort' program * Minor improvements in all pdf macros TeX Live: * CTWILL in TeX Live uses 'kpse_find_file' to look up 'bux' files * Slightly extend arrays in 'ctwill' and 'refsort' for TeX Live * Max out 'max_refs' for CWEAVE/CTWILL * Add 'ctwill.test' for TeX Live Revise formatted sources: * e.g., 'twinx' * 'ctwill' in all its incarnations dito.
1 parent f8a6d84 commit ec6dcad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+4886
-1330
lines changed

0001-Support-extended-syntax-for-numeric-literals.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From ba514ca2a52ab65e46d3477724672564cb492646 Mon Sep 17 00:00:00 2001
22
From: Andreas Scherer <[email protected]>
33
Date: Mon, 29 Mar 2021 13:14:34 +0200
4-
Subject: [PATCH 1/4] Support extended syntax for numeric literals.
4+
Subject: [PATCH 1/5] Support extended syntax for numeric literals.
55

66
---
77
ctwimac.tex | 15 ++++++++++-----
@@ -90,5 +90,5 @@ index 29533b8..dbcf312 100644
9090
\hbox{\strut\kern2pt\.{#1}\kern2pt}}
9191
\hrule}\vrule\kern2pt}} % verbatim string
9292
--
93-
2.35.1
93+
2.41.0
9494

0002-Purge-redundant-TeX-macro.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From a5ee9d7e41df5d084cdbd23a9e43cdd9e31c1e6c Mon Sep 17 00:00:00 2001
22
From: Andreas Scherer <[email protected]>
33
Date: Thu, 8 Apr 2021 14:44:11 +0200
4-
Subject: [PATCH 2/4] Purge redundant '\TeX' macro.
4+
Subject: [PATCH 2/5] Purge redundant '\TeX' macro.
55

66
---
77
ctwimac.tex | 5 +----
@@ -68,5 +68,5 @@ index 99ae604..89e3b68 100644
6868
\let\mc=\ninerm % medium caps
6969
\def\CEE/{{\mc C\spacefactor1000}}
7070
--
71-
2.35.1
71+
2.41.0
7272

0003-Adapt-to-CWEB-4.5.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 3e8c31f1e457bb6e9c589a3ae7574a753033d8b6 Mon Sep 17 00:00:00 2001
1+
From eb98776596c3d9504243de133819946540fa609a Mon Sep 17 00:00:00 2001
22
From: Andreas Scherer <[email protected]>
33
Date: Wed, 7 Jul 2021 13:57:00 +0200
4-
Subject: [PATCH 3/4] Adapt to CWEB 4.5.
4+
Subject: [PATCH 3/5] Adapt to CWEB 4.5.
55

66
---
77
ctwimac.tex | 40 ++++++++++++++++++++--------------------
@@ -190,7 +190,7 @@ index ccfd36b..c0b4fa6 100644
190190
\def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue
191191
\newif\ifon \newif\iftitle \newif\ifpagesaved
192192
diff --git a/twinxmac.tex b/twinxmac.tex
193-
index 89e3b68..30d4449 100644
193+
index 89e3b68..6d9ac2f 100644
194194
--- a/twinxmac.tex
195195
+++ b/twinxmac.tex
196196
@@ -8,6 +8,8 @@
@@ -240,7 +240,7 @@ index 89e3b68..30d4449 100644
240240
+ \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant
241241
\def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
242242
- \let\~=\oct \let\^=\hex #1}$}}
243-
+ \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$%
243+
+ \let\~=\oct \let\^=\hex \let\\=\bin #1}$}}%$%
244244
\def\U{\note{This code is used in section}} % xref for use of a section
245245
\def\Us{\note{This code is used in sections}} % xref for uses of a section
246246
\let\V=\lor % logical or
@@ -266,5 +266,5 @@ index 89e3b68..30d4449 100644
266266
\def\normaloutput#1{\shipout\vbox{
267267
\vbox to 3pc{\ifodd\pageno\rightheadline\else\leftheadline\fi\vfill}
268268
--
269-
2.35.1
269+
2.41.0
270270

0004-Add-silent-datecontentspage-macro.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 29dbd33008c665abe8235cca32f73721771a5e6a Mon Sep 17 00:00:00 2001
1+
From e1d2ad3d3bde4a6d5611b4627a9feb43118a87fa Mon Sep 17 00:00:00 2001
22
From: Andreas Scherer <[email protected]>
33
Date: Thu, 10 Feb 2022 09:24:39 +0100
4-
Subject: [PATCH 4/4] Add silent \datecontentspage macro.
4+
Subject: [PATCH 4/5] Add silent \datecontentspage macro.
55

66
---
77
ctwimac.tex | 2 +-
@@ -21,5 +21,5 @@ index df24900..014168b 100644
2121
% To produce only a subset of pages, put the page numbers on separate
2222
% lines in a file called pages.tex
2323
--
24-
2.35.1
24+
2.41.0
2525

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
From 6b42e6c76f705f1adc9ef62ddc63318df9676d42 Mon Sep 17 00:00:00 2001
2+
From: Andreas Scherer <[email protected]>
3+
Date: Wed, 14 Jun 2023 10:00:33 +0200
4+
Subject: [PATCH 5/5] Update CTWILL macros for CWEB 4.9.
5+
6+
---
7+
ctwimac.tex | 10 ++++++----
8+
proofmac.tex | 12 ++++++------
9+
twinxmac.tex | 2 +-
10+
3 files changed, 13 insertions(+), 11 deletions(-)
11+
12+
diff --git a/ctwimac.tex b/ctwimac.tex
13+
index 014168b..d65f5bf 100644
14+
--- a/ctwimac.tex
15+
+++ b/ctwimac.tex
16+
@@ -1,9 +1,9 @@
17+
% standard macros for CWEB listings (in addition to plain.tex)
18+
-% Version 4.5 --- October 2021
19+
+% Version 4.9 --- June 2023
20+
% modified for pages produced by CTWILL
21+
% further modified for page size of the MMIXware book
22+
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
23+
-\xdef\fmtversion{\fmtversion+CTWILL4.5+LNCS}
24+
+\xdef\fmtversion{\fmtversion+CTWILL4.9+LNCS}
25+
26+
\let\:=\. % preserve a way to get the dot accent
27+
% (all other accents will still work as usual)
28+
@@ -31,6 +31,8 @@
29+
\def\Cee{\CEE/} % for backward compatibility
30+
\def\Cpp{\CPLUSPLUS/} % for backward compatibility
31+
\def\9#1{}
32+
+ % with this definition of \9 you can say @:sort key}{TeX code@>
33+
+ % to alphabetize an index entry by the sort key but format with the TeX code
34+
\font\eightrm=cmr8
35+
\font\sixrm=cmr6
36+
\font\ninei=cmmi9
37+
@@ -251,7 +253,7 @@
38+
\let\G=\ge % greater than or equal sign
39+
% \H is long Hungarian umlaut accent
40+
\let\I=\ne % unequal sign
41+
-\def\J{\.{@\&}} % TANGLE's join operation
42+
+\def\J{\.{@\&}} % CTANGLE's join operation
43+
\let\K== % assignment operator
44+
%\let\K=\leftarrow % "honest" alternative to standard assignment operator
45+
% \L is Polish letter suppressed-L
46+
@@ -459,7 +461,7 @@
47+
\def\Us{\note{Used in sections}} % crossref for uses of a section
48+
\def\I{\par\hangindent 2em}\let\*=*
49+
\readsections}
50+
-\def\readsections{\input \jobname.sscn}
51+
+\def\readsections{\input \jobname.scn}
52+
\def\datethis{} \def\datecontentspage{}
53+
54+
% To produce only a subset of pages, put the page numbers on separate
55+
diff --git a/proofmac.tex b/proofmac.tex
56+
index c0b4fa6..8cfe398 100644
57+
--- a/proofmac.tex
58+
+++ b/proofmac.tex
59+
@@ -1,8 +1,8 @@
60+
% standard macros for CWEB listings (in addition to plain.tex)
61+
-% Version 4.5 --- October 2021
62+
+% Version 4.9 --- June 2023
63+
% Modified for proofs in CTWILL
64+
-\ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros
65+
-\xdef\fmtversion{\fmtversion+CWEB4.5+PROOFS}
66+
+\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
67+
+\xdef\fmtversion{\fmtversion+CTWILL4.9+PROOFS}
68+
69+
\let\:=\. % preserve a way to get the dot accent
70+
% (all other accents will still work as usual)
71+
@@ -115,7 +115,7 @@
72+
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
73+
\noindent{\let\*=\lapstar\bf\secstar.\quad}}
74+
\let\startsection=\stsec
75+
-\def\defin#1{\global\advance\ind by 2 \1\&{#1 } } % begin `define' or `format'
76+
+\def\defin#1{\global\advance\ind by 2 \1\&{#1 }} % begin `define' or `format'
77+
\def\A{\note{See also section}} % xref for doubly defined section name
78+
\def\As{\note{See also sections}} % xref for multiply defined section name
79+
\def\B{\rightskip=0pt plus 100pt minus 10pt % go into C mode
80+
@@ -128,7 +128,7 @@
81+
\let\SHC\C % "// short comments" treated like "/* ordinary comments */"
82+
%\def\C#1{\5\5\quad$\triangleright\,${\cmntfont#1}$\,\triangleleft$}
83+
%\def\SHC#1{\5\5\quad$\diamond\,${\cmntfont#1}}
84+
-\def\D{\defin{\#define}} % macro definition
85+
+\def\D{\defin{{\rm\#}define}} % macro definition
86+
\let\E=\equiv % equivalence sign
87+
\def\ET{ and~} % conjunction between two section numbers
88+
\def\ETs{, and~} % conjunction between the last two of several section numbers
89+
@@ -136,7 +136,7 @@
90+
\let\G=\ge % greater than or equal sign
91+
% \H is long Hungarian umlaut accent
92+
\let\I=\ne % unequal sign
93+
-\def\J{\.{@\&}} % TANGLE's join operation
94+
+\def\J{\.{@\&}} % CTANGLE's join operation
95+
\let\K== % assignment operator
96+
%\let\K=\leftarrow % "honest" alternative to standard assignment operator
97+
% \L is Polish letter suppressed-L
98+
diff --git a/twinxmac.tex b/twinxmac.tex
99+
index 6d9ac2f..6865478 100644
100+
--- a/twinxmac.tex
101+
+++ b/twinxmac.tex
102+
@@ -213,7 +213,7 @@
103+
\let\G=\ge % greater than or equal sign
104+
% \H is long Hungarian umlaut accent
105+
\let\I=\ne % unequal sign
106+
-\def\J{\.{@\&}} % TANGLE's join operation
107+
+\def\J{\.{@\&}} % CTANGLE's join operation
108+
\let\K== % can be changed to left arrow, if desired
109+
% \L is Polish letter suppressed-L; we have no shorthand for \le
110+
% \O is Scandinavian letter O-with-slash
111+
--
112+
2.41.0
113+

Makefile.unix

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
# Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
55
#
66
# Modified for GCC under Linux by Andreas Scherer, June 8, 1996.
7-
# Last updated by Andreas Scherer, August 2022.
7+
# Last updated by Andreas Scherer, August 2023.
88

99
# The following copyright notice extends to the changes in this Makefile
1010
# only, not to any part of the original CWEB distribution.
1111
#
12-
# Copyright (C) 1994, 1996, 2000, 2005, 2022 Andreas Scherer
12+
# Copyright (C) 1994, 1996, 2000, 2005, 2022-2023 Andreas Scherer
1313

1414
# Permission is granted to make and distribute verbatim copies of this
1515
# document provided that the copyright notice and this permission notice
@@ -193,7 +193,7 @@ PATCH = common.$(EXTENSION) ctangle.$(EXTENSION) README.txt Makefile.unix \
193193
cwebbin.spec examples/wmerge.dsp ctangle.1 cweave.1 ctwill.md \
194194
refsort.1 twinx.1 refsort.ch twinx.ch \
195195
LICENSE README.md texlive.w system.bux \
196-
common.bux comm-mini.ch ctwill.bux ctwill-mini.ch
196+
common.bux comm-mini.ch ctwill.bux ctwill-mini.ch ctwill-hint.ch
197197

198198
EXAMPLES = examples/cct.w examples/commonwords.w examples/extex-ansi.ch \
199199
examples/Makefile.sas examples/matrix.w examples/primes.ch \
@@ -356,7 +356,7 @@ fullmanual: usermanual $(SOURCES) \
356356
$(CWEAVE) cweave.w ctwill-doc.ch ctwill; $(MAKE) ctwill.pdf
357357

358358
cwebbin.tex: cwebman.tex $(DCHANGES)
359-
$(TIE) -m $@ $^; $(SUBVER)
359+
$(TIE) -m $@ $^ && $(SUBVER)
360360
$(SED_I) -e "1,90 s/\(CWEBbin\)/\\\\.{\1}/" \
361361
-e "91,$$ s/\(CWEBbin\)/\\\\\\\\.\\\\{\1\\\\}/" $@
362362

@@ -365,16 +365,16 @@ cwebbin.tex: cwebman.tex $(DCHANGES)
365365
# change files listed above are actually used here, so you won't see
366366
# any system-dependent parts not available under UNIX.
367367
comm-doc.ch: common.w $(CCHANGES) comm-man.ch comm-newpage.ch
368-
$(TIE) -c $@ $^; $(SUBVER)
368+
$(TIE) -c $@ $^ && $(SUBVER)
369369
$(SED_I) -e "1,20 s/\(CWEBbin\)/\\\\.{\1}/" $@
370370
ctang-doc.ch: ctangle.w $(TCHANGES) ctang-man.ch ctang-newpage.ch
371-
$(TIE) -c $@ $^; $(SUBVER)
371+
$(TIE) -c $@ $^ && $(SUBVER)
372372
$(SED_I) -e "1,20 s/\(CWEBbin\)/\\\\.{\1}/" $@
373373
cweav-doc.ch: cweave.w $(WCHANGES) cweav-man.ch cweav-newpage.ch
374-
$(TIE) -c $@ $^; $(SUBVER)
374+
$(TIE) -c $@ $^ && $(SUBVER)
375375
$(SED_I) -e "1,20 s/\(CWEBbin\)/\\\\.{\1}/" $@
376376
ctwill-doc.ch: cweave.w $(LCHANGES) ctwill-man.ch
377-
$(TIE) -c $@ $^; $(SUBVER)
377+
$(TIE) -c $@ $^ && $(SUBVER)
378378
$(SED_I) -e "1,40 s/\(CWEBbin\)/\\\\.{\1}/" $@
379379

380380
# for making the documentation we will have to include the change files
@@ -396,23 +396,23 @@ common.tex: common.w $(CCHANGES)
396396
# the resulting sources to Amiga (or MS/DOS).
397397
$(CCHANGES): common.w comm-patch.ch comm-extensions.ch \
398398
comm-output.ch comm-i18n.ch # comm-texlive.ch
399-
$(TIE) -c $@ $^; $(SUBVER)
399+
$(TIE) -c $@ $^ && $(SUBVER)
400400
$(HCHANGES): common.h comm-extensions.hch \
401401
comm-output.hch comm-i18n.hch # comm-texlive.hch
402402
$(TIE) -m $@ $^
403403
$(TCHANGES): ctangle.w ctang-patch.ch ctang+u.ch \
404404
ctang-output.ch ctang-i18n.ch # ctang-texlive.ch
405-
$(TIE) -c $@ $^; $(SUBVER)
405+
$(TIE) -c $@ $^ && $(SUBVER)
406406
$(WCHANGES): cweave.w cweav-patch.ch cweav-extensions.ch \
407407
cweav-output.ch cweav-i18n.ch # cwtw-texlive.ch cweav-texlive.ch
408-
$(TIE) -c $@ $^; $(SUBVER)
408+
$(TIE) -c $@ $^ && $(SUBVER)
409409
$(LCHANGES): cweave.w cweav-patch.ch cweav-extensions.ch \
410410
cweav-output.ch cweav-i18n.ch \
411411
cweav-twill.ch # cwtw-texlive.ch ctwill-texlive.ch
412-
$(TIE) -c $@ $^; $(SUBVER)
412+
$(TIE) -c $@ $^ && $(SUBVER)
413413
$(DCHANGES): cwebman.tex cwebman-patch.ch \
414414
cwebman-extensions.ch # cwebman-texlive.ch
415-
$(TIE) -c $@ $^; $(SUBVER)
415+
$(TIE) -c $@ $^ && $(SUBVER)
416416

417417
# be sure to leave ctangle.$(EXTENSION) and common.$(EXTENSION)
418418
# for bootstrapping
@@ -434,6 +434,7 @@ install: all
434434
$(INSTALL) cweave $(DESTDIR)$(BINDIR)/$(DESTPREF)weave
435435
$(INSTALL) ctwill $(DESTDIR)$(BINDIR)/$(DESTPREF)twill
436436
$(INSTALL) refsort $(DESTDIR)$(BINDIR)/refsort
437+
$(INSTALL) proofsort $(DESTDIR)$(BINDIR)/proofsort
437438
$(INSTALL) twinx $(DESTDIR)$(BINDIR)/twinx
438439

439440
$(INSTALL) -m 644 cweb.1 $(DESTDIR)$(MANDIR)/cweb.$(MANEXT)

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[cweb system](http://www-cs-faculty.stanford.edu/~uno/cweb.html)
55
and donald e. knuth's [ctwill program](http://ftp.cs.stanford.edu/pub/ctwill).
66
it requires the contents of [the original *cweb* source
7-
drop](https://github.com/ascherer/cweb/releases/download/cweb-4.9/cweb-4.9.tar.gz)
7+
drop](https://github.com/ascherer/cweb/releases/download/cweb-4.10/cweb-4.10.tar.gz)
88
and [the secondary *ctwill* source
99
drop](http://ftp.cs.stanford.edu/pub/ctwill/ctwill.tar.gz), to which it applies
1010
a set of change files to introduce advanced features. see the extensive
@@ -23,11 +23,11 @@ a set of change files to introduce advanced features. see the extensive
2323

2424
## manual compilation
2525

26-
extract `ctwill.tar.gz` and add the contents of `cweb-4.9.tar.gz` (overwriting
26+
extract `ctwill.tar.gz` and add the contents of `cweb-4.10.tar.gz` (overwriting
2727
outdated source files `Makefile`, `common.h`, `common.w`, and `prod.w`) and
2828
`cwebbin-2023.tar.gz` for the full set of source files.
2929
replace `@@VERSION@@` in line 129 of the `Makefile.unix` with something like
30-
`Version 4.9 [CWEBbin 2023]`.
30+
`Version 4.10 [CWEBbin 2023]`.
3131
`touch *.cxx`.
3232
unix/linux users should work with [`make -f Makefile.unix`](Makefile.unix)
3333
exclusively (targets `boot`, `cautiously`, and `all`).
@@ -47,20 +47,21 @@ clone
4747
[cweb](https://github.com/ascherer/cweb) and
4848
[cwebbin](https://github.com/ascherer/cwebbin), create the source drops with
4949
```
50-
git archive -o cweb-4.9.tar.gz cweb-4.9
51-
git archive -o cwebbin-2023.tar.gz cwebbin-2023
50+
git archive -o cweb-4.10.tar.gz cweb-4.10
51+
git archive -o cwebbin-2023.tar.gz cwebbin-2023.2
5252
```
5353
respectively, put these two tarballs and the original `ctwill.tar.gz` in the
5454
*SOURCES* directory, add the patch files
5555
* `0001-Support-extended-syntax-for-numeric-literals.patch`
5656
* `0002-Purge-redundant-TeX-macro.patch`
5757
* `0003-Adapt-to-CWEB-4.5.patch`
5858
* `0004-Add-silent-datecontentspage-macro.patch`
59+
* `0005-Update-CTWILL-macros-for-CWEB-4.9.patch`
5960

6061
to *SOURCES* also, and place `cwebbin.spec` in the *SPECS* directory of your
6162
build arena.
6263

63-
the four patch files upgrade the *ctwill* macros for modern cweb. originally,
64+
the five patch files upgrade the *ctwill* macros for modern cweb. originally,
6465
they come from branch
6566
[update-macros-for-cweb-4](https://github.com/ascherer/ctwill/tree/update-macros-for-cweb-4)
6667
and can be recreated by `git format-patch master` in the archived
@@ -95,5 +96,5 @@ macros, and cweb include files.
9596
updated versions of **cweb** are added to the texlive source tree with
9697
```
9798
cd /path/to/texlive-source/texk/web2c/cwebdir
98-
pax -rzf /path/to/cweb-4.9.tar.gz
99+
pax -rzf /path/to/cweb-4.10.tar.gz
99100
```

README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-*-Text-*-
22
%%% LEGALESE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33

4-
% This file is part of CWEBbin (Version 4.9 [2023]).
4+
% This file is part of CWEBbin (Version 4.10 [2023]).
55
% (Set TAB to 8 spaces to get the spacing right.)
66
% The CWEB programs by Silvio Levy are based on programs by D. E. Knuth.
77
% They are distributed WITHOUT ANY WARRANTY, express or implied.

0 commit comments

Comments
 (0)