texlive[72278] Build/source/texk/web2c/cwebdir: {CWEB] Fix sorting
commits+ascherer at tug.org
commits+ascherer at tug.org
Sat Sep 14 15:14:52 CEST 2024
Revision: 72278
https://tug.org/svn/texlive?view=revision&revision=72278
Author: ascherer
Date: 2024-09-14 15:14:52 +0200 (Sat, 14 Sep 2024)
Log Message:
-----------
{CWEB] Fix sorting order in Nanes-of-the-Sections.
Note that 'cweb[acro]mac.tex' has learned to purge the '\9' macro with a
single-character argument in the PDF outlines.
Modified Paths:
--------------
trunk/Build/source/texk/web2c/cwebdir/ChangeLog
trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/cweave.w
trunk/Build/source/texk/web2c/cwebdir/cwebacromac.tex
trunk/Build/source/texk/web2c/cwebdir/cwebmac.tex
trunk/Build/source/texk/web2c/cwebdir/refsort.ch
Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2024-09-13 23:42:03 UTC (rev 72277)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2024-09-14 13:14:52 UTC (rev 72278)
@@ -1,5 +1,15 @@
2024-08-12 Andreas Scherer <https://ascherer.github.io>
+ * ctwill-mini.c,
+ * ctwill-w2c.ch,
+ * cweav-w2c.ch,
+ * cweave.w,
+ * cwebacromac.tex,
+ * cwebmac.tex,
+ * refsort.ch: Fix sorting order in Names-of-the-Sections.
+
+2024-08-12 Andreas Scherer <https://ascherer.github.io>
+
* Makefile
* comm-{mac,mini,ql,w2c}.ch
* comm-w2c.h
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2024-09-13 23:42:03 UTC (rev 72277)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2024-09-14 13:14:52 UTC (rev 72278)
@@ -1589,9 +1589,9 @@
Section 215.
@x
-@<Append a string or...@>={@+ int count=-1; /* characters remaining before string break */
+@<Append a \9{s}string or...@>={@+ int count=-1; /* characters remaining before string break */
@y
-@<Append a string or...@>={int count=-1; /* characters remaining before string break */
+@<Append a \9{s}string or...@>={@+ int count=-1; /* characters remaining before string break */
@z
Section 220.
@@ -1819,12 +1819,12 @@
@x
@ @d usage_sentinel (struct perm_meaning *)1
-@<Translate the current section@>= {
+@<Translate the \9{c}current section@>= {
@y
@ @d usage_sentinel (struct perm_meaning *)1
@-usage_sentinel@>
@$usage_sentinel {CTWILL}247 =(\&{struct} \&{perm\_meaning} ${}{*}{}$) \T{1}@>
-@<Translate the current section@>=@+ {
+@<Translate the \9{c}current section@>= {
@z
Section 251.
@@ -1851,9 +1851,9 @@
Section 254.
@x
-@ @<Start a format...@>= {
+@ @<Start \9{a}a format...@>= {
@y
- at r @ @<Start a format...@>= {
+ at r @ @<Start \9{a}a format...@>= {
@z
Section 255.
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2024-09-13 23:42:03 UTC (rev 72277)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2024-09-14 13:14:52 UTC (rev 72278)
@@ -466,7 +466,7 @@
tricky way so that the first line of the output file will be
`\.{\\input cwebmac}'.
-@<Start \TEX/...@>=
+@<Start \9{t}\TEX/...@>=
out_ptr=out_buf+1; out_line=1; active_file=tex_file;
tex_printf("\\input cwebma"); *out_ptr='c';
@y
@@ -486,7 +486,7 @@
@d proofing flags['P']
-@<Start \TEX/...@>=
+@<Start \9{t}\TEX/...@>=
out_ptr=out_buf+1; out_line=1; active_file=tex_file;
tex_puts("\\input ");
tex_printf(use_language);
@@ -952,7 +952,7 @@
@x [12.229] l.4212
static boolean group_found=false; /* has a starred section occurred? */
-@ @<Translate the current section@>= {
+@ @<Translate the \9{c}current section@>= {
section_count++;
@y
static boolean group_found=false; /* has a starred section occurred? */
@@ -960,7 +960,7 @@
static boolean temp_switch; /* has `\.{@@\%}' occurred recently? */
@ @d usage_sentinel (struct perm_meaning *)1
-@<Translate the current section@>= {
+@<Translate the \9{c}current section@>= {
section_count++;
temp_switch=false; temp_meaning_ptr=temp_meaning_stack;
top_usage=usage_sentinel;
@@ -1040,9 +1040,9 @@
@z
@x [12.236] l.4340
-@<Start a macro...@>= {
+@<Start \9{a}a macro...@>= {
@y
-@<Start a macro...@>= {
+@<Start \9{a}a macro...@>= {
is_macro=true;
@z
@@ -1073,10 +1073,10 @@
@z
@x [12.237] l.4369
-@ @<Start a format...@>= {
+@ @<Start \9{a}a format...@>= {
doing_format=true;
@y
-@ @<Start a format...@>= {
+@ @<Start \9{a}a format...@>= {
doing_format=true;
is_macro=false;
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch 2024-09-13 23:42:03 UTC (rev 72277)
+++ trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch 2024-09-14 13:14:52 UTC (rev 72278)
@@ -195,7 +195,7 @@
tricky way so that the first line of the output file will be
`\.{\\input cwebmac}'.
-@<Start \TEX/...@>=
+@<Start \9{t}\TEX/...@>=
out_ptr=out_buf+1; out_line=1; active_file=tex_file;
tex_printf("\\input cwebma"); *out_ptr='c';
@y
@@ -210,7 +210,7 @@
Without this option the first line of the output file will be
`\.{\\input cwebmac}'.
-@<Start \TEX/...@>=
+@<Start \9{t}\TEX/...@>=
out_ptr=out_buf+1; out_line=1; active_file=tex_file;
tex_puts("\\input ");
tex_printf(use_language);
Modified: trunk/Build/source/texk/web2c/cwebdir/cweave.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweave.w 2024-09-13 23:42:03 UTC (rev 72277)
+++ trunk/Build/source/texk/web2c/cwebdir/cweave.w 2024-09-14 13:14:52 UTC (rev 72278)
@@ -93,7 +93,7 @@
program=cweave;
@<Set initial values@>@;
common_init();
- @<Start \TEX/ output@>@;
+ @<Start \9{t}\TEX/ output@>@;
if (show_banner) puts(banner); /* print a ``banner line'' */
@<Store all the reserved words@>@;
phase_one(); /* read all the user's text and store the cross-references */
@@ -1076,9 +1076,9 @@
printf("*%d",(int)section_count);
update_terminal(); /* print a progress report */
}
- @<Store cross-references in the \TEX/ part of a section@>@;
- @<Store cross-references in the definition part of a section@>@;
- @<Store cross-references in the \CEE/ part of a section@>@;
+ @<Store cross-references in the \9{t}\TEX/ part of a section@>@;
+ @<Store cross-references in the \9{d}definition part of a section@>@;
+ @<Store cross-references in the \9{c}\CEE/ part of a section@>@;
if (changed_section[section_count]) change_exists=true;
}
@@ -1155,7 +1155,7 @@
enclosed in \.{@@\^}$\,\ldots\,$\.{@@>} or \.{@@.}$\,\ldots\,$\.{@@>}
or \.{@@:}$\,\ldots\,$\.{@@>}.
-@<Store cross-references in the \T...@>=
+@<Store cross-references in the \9{t}\T...@>=
while (true) {
switch (next_control=skip_TeX()) {
case translit_code: err_print("! Use @@l in limbo only"); continue;
@@ -1204,7 +1204,7 @@
@ When we get to the following code we have |next_control>=format_code|.
-@<Store cross-references in the d...@>=
+@<Store cross-references in the \9{d}d...@>=
while (next_control<=definition) { /* |format_code| or |definition| */
if (next_control==definition) {
xref_switch=def_flag; /* implied \.{@@!} */
@@ -1261,7 +1261,7 @@
@ Finally, when the \TEX/ and definition parts have been treated, we have
|next_control>=begin_C|.
-@<Store cross-references in the \CEE/...@>=
+@<Store cross-references in the \9{c}\CEE/...@>=
if (next_control<=section_name) { /* |begin_C| or |section_name| */
if (next_control==begin_C) section_xref_switch=0;
else {
@@ -1398,7 +1398,7 @@
tricky way so that the first line of the output file will be
`\.{\\input cwebmac}'.
-@<Start \TEX/...@>=
+@<Start \9{t}\TEX/...@>=
out_ptr=out_buf+1; out_line=1; active_file=tex_file;
tex_printf("\\input cwebma"); *out_ptr='c';
@@ -3420,10 +3420,10 @@
app_scrap(section_scrap,maybe_math);@+
app_scrap(exp,yes_math);@+break;
case string: case constant: case verbatim:
- @<Append a string or constant@>@;@+break;
+ @<Append a \9{s}string or constant@>@;@+break;
case identifier: app_cur_id(true);@+break;
case TeX_string:
- @<Append a \TEX/ string, without forming a scrap@>@;@+break;
+ @<Append a \9{t}\TEX/ string, without forming a scrap@>@;@+break;
case '/': case '.':
app(next_control);@+app_scrap(binop,yes_math);@+break;
case '<': app_str("\\langle");@+app_scrap(prelangle,yes_math);@+break;
@@ -3545,7 +3545,7 @@
\TEX/ will print them properly.
@^special string characters@>
-@<Append a string or...@>={@+ int count=-1; /* characters remaining before string break */
+@<Append a \9{s}string or...@>={@+ int count=-1; /* characters remaining before string break */
switch (next_control) {
case constant: app_str("\\T{"@q}@>); break;
@.\\T@>
@@ -3611,7 +3611,7 @@
the \TEX/ string is treated as an expression.
@^bug, known@>
-@<Append a \TEX/ string, without forming a scrap@>=
+@<Append a \9{t}\TEX/ string, without forming a scrap@>=
app_str("\\hbox{"@q}@>);
@^high-bit character handling@>
while (id_first<id_loc) {
@@ -4183,7 +4183,7 @@
section_count=0; format_visible=true; copy_limbo();
finish_line(); flush_buffer(out_buf,false,false);
/* insert a blank line, it looks nice */
-while (!input_has_ended) @<Translate the current section@>@;
+while (!input_has_ended) @<Translate the \9{c}current section@>@;
}
@ @<Predecl...@>=@+static void phase_two(void);
@@ -4211,13 +4211,13 @@
static boolean doing_format=false; /* are we outputting a format declaration? */
static boolean group_found=false; /* has a starred section occurred? */
-@ @<Translate the current section@>= {
+@ @<Translate the \9{c}current section@>= {
section_count++;
@<Output the code for the beginning of a new section@>@;
save_position();
- @<Translate the \TEX/ part of the current section@>@;
- @<Translate the definition part of the current section@>@;
- @<Translate the \CEE/ part of the current section@>@;
+ @<Translate the \9{t}\TEX/ part of the current section@>@;
+ @<Translate the \9{d}definition part of the current section@>@;
+ @<Translate the \9{c}\CEE/ part of the current section@>@;
@<Show cross-references to this section@>@;
@<Output the code for the end of a section@>@;
}
@@ -4257,7 +4257,7 @@
@ In the \TEX/ part of a section, we simply copy the source text, except that
index entries are not copied and \CEE/ text within \pb\ is translated.
-@<Translate the \T...@>= do
+@<Translate the \9{t}\T...@>= do
switch (next_control=copy_TeX()) {
case '|': init_stack(); output_C(); break;
case '@@': out('@@'); break;
@@ -4279,12 +4279,12 @@
@ When we get to the following code we have |next_control>=format_code|, and
the token memory is in its initial empty state.
-@<Translate the d...@>=
+@<Translate the \9{d}d...@>=
space_checked=false;
while (next_control<=definition) { /* |format_code| or |definition| */
init_stack();
- if (next_control==definition) @<Start a macro definition@>@;
- else @<Start a format definition@>@;
+ if (next_control==definition) @<Start \9{a}a macro definition@>@;
+ else @<Start \9{a}a format definition@>@;
outer_parse(); finish_C(format_visible); format_visible=true;
doing_format=false;
}
@@ -4337,7 +4337,7 @@
text starts immediately after the identifier. In the former case,
it starts after we scan the matching `\.)'.
-@<Start a macro...@>= {
+@<Start \9{a}a macro...@>= {
if (save_line!=out_line || save_place!=out_ptr || space_checked) app(backup);
if(!space_checked){emit_space_if_needed();save_position();}
app_str("\\D"); /* this will produce `\#\&{define }' */
@@ -4366,7 +4366,7 @@
}
}
-@ @<Start a format...@>= {
+@ @<Start \9{a}a format...@>= {
doing_format=true;
if(*(loc-1)=='s' || *(loc-1)=='S') format_visible=false;
if(!space_checked){emit_space_if_needed();save_position();}
@@ -4394,7 +4394,7 @@
@<Private...@>=
static name_pointer this_section; /* the current section name, or zero */
-@ @<Translate the \CEE/...@>=
+@ @<Translate the \9{c}\CEE/...@>=
this_section=name_dir;
if (next_control<=section_name) {
emit_space_if_needed(); init_stack();
Modified: trunk/Build/source/texk/web2c/cwebdir/cwebacromac.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cwebacromac.tex 2024-09-13 23:42:03 UTC (rev 72277)
+++ trunk/Build/source/texk/web2c/cwebdir/cwebacromac.tex 2024-09-14 13:14:52 UTC (rev 72278)
@@ -17,6 +17,16 @@
\let\pdfoutput=\outputmode
\fi % end of LuaTeX->pdfTeX redirection macros
+\def\pdfURL#1#2{\ifpdf \ifpdflua\pdfannotlink height \theheight depth \thedepth
+ attr {/Border [0 0 0]} user { /Type /Annot /Subtype /Link /A
+ << /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69
+ \else {\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
+ \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight
+ depth \thedepth << /Border [0 0 0] /Type /Annot /Subtype /Link /A
+ << /S /URI /URI (#2) >> >>}\box0\relax}\fi
+ \else #1 ({\tt#2})\fi}
+{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL
+{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL
\def\tocpages{1} % Most programs have one-page Table-of-Contents
\def\startpdf{\def\pagemode{/PageMode /UseOutlines}
\ifnum\contentspagenumber=0 \advance \pageno by -\tocpages
@@ -66,8 +76,7 @@
\fi
\else \addtokens\toksC{\the\toksD}\global\havenumtrue
\fi
- \next
-}
+ \next}
\def\makenote{\addtokens\toksB
{\noexpand\pdflink{\the\toksC}}\toksC={}\global\havenumfalse}
\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
@@ -99,6 +108,7 @@
\afterassignment\makeolproctok\let\nxt= }
\def\makeolnexttok{\afterassignment\makeolproctok\let\nxt= }
\def\makeolgobbletok{\afterassignment\makeolnexttok\let\nxt= }
+\def\makeolgobbletokk{\afterassignment\makeolgobbletok\let\nxt= }
\def\addF#1{\addtokens\toksF{#1}\tokprocessedtrue}
% now comes a routine to "sanitize" section names, for pdf outlines
\def\makeolproctok{\tokprocessedfalse
@@ -109,8 +119,7 @@
\else\ifx^\nxt \addF^\else\ifx_\nxt \addF_% sanitize ^ and _
\else\ifx\nxt\spacechar \addF\space
\else\if\noexpand\nxt\relax % we have a control sequence; is it one we know?
- \ifx\nxt~\addF\space
- \else\ifx\nxt\onespace\addF\space
+ \ifx\nxt~\addF\space \else\ifx\nxt\onespace\addF\space
\else\the\sanitizer
\iftokprocessed\else\makeolproctokctli
\iftokprocessed\else\makeolproctokctlii
@@ -124,8 +133,7 @@
\else\expandafter\makeolproctokchar\meaning\nxt
\fi\fi\fi\fi\fi
\fi\fi\fi\fi\fi \fi\fi\fi
- \next
-}
+ \next}
\def\makeolproctokchar#1 #2 #3{\addF{#3}}
\def\makeolproctokctli{%
\ifx\nxt\CEE\addF{C}\let\next\makeolgobbletok % \CEE/
@@ -133,8 +141,9 @@
\else\ifx\nxt\TEX\addF{TeX}\let\next\makeolgobbletok % \TEX/
\else\ifx\nxt\TeX\addF{TeX}\else\ifx\nxt\LaTeX\addF{LaTeX}%
\else\ifx\nxt\CPLUSPLUS\addF{C++}\let\next\makeolgobbletok % \CPLUSPLUS/
- \else\ifx\nxt\Cee\addF{C}%
+ \else\ifx\nxt\Cee\addF{C}\else\ifx\nxt\dots\addF{...\space}%
\else\ifx\nxt\PB \let\next\makeolgobbletok \tokprocessedtrue % \PB{...}
+ \else\ifx\nxt\9 \expandafter\nxt\relax \let\next\makeolgobbletokk % \9{#1}
\else\ifx\nxt\.\tokprocessedtrue\instrtrue % \.{...}
% skip \|
\else\ifx\nxt\\\ifinstr\addF{\bschar\bschar}\else\tokprocessedtrue\fi
@@ -149,7 +158,7 @@
\else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}%
\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi
\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi
- \fi\fi
+ \fi\fi\fi\fi
}
\def\makeolproctokctlii{%
\ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}%
Modified: trunk/Build/source/texk/web2c/cwebdir/cwebmac.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cwebmac.tex 2024-09-13 23:42:03 UTC (rev 72277)
+++ trunk/Build/source/texk/web2c/cwebdir/cwebmac.tex 2024-09-14 13:14:52 UTC (rev 72278)
@@ -132,16 +132,6 @@
\def\Blue{\pdfliteral{\pdflinkcolor\space rg \pdflinkcolor\space RG}}
\fi
\input cwebacromac % load hypertext macros
-\def\pdfURL#1#2{\ifpdf \ifpdflua\pdfannotlink height \theheight depth \thedepth
- attr {/Border [0 0 0]} user { /Type /Annot /Subtype /Link /A
- << /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69
- \else {\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
- \special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight
- depth \thedepth << /Border [0 0 0] /Type /Annot /Subtype /Link /A
- << /S /URI /URI (#2) >> >>}\box0\relax}\fi
- \else #1 ({\tt#2})\fi}
-{\catcode`\~=12 \gdef\TILDE/{~}} % ~ in a URL
-{\catcode`\_=12 \gdef\UNDER/{_}} % _ in a URL
\def\lapstar{\rlap{*}}
\def\stsec{\rightskip=0pt % get out of C mode (cf. \B)
@@ -242,9 +232,8 @@
\def\p#1{\cdot 2^{#1}} % power of two (hex exponent)
\def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue
-\newif\ifon \newif\iftitle \newif\ifpagesaved
+\newif\ifon \newif\iftitle \newif\ifpagesaved \newif\ifheader
-\newif\ifheader
\def\lheader{\headertrue\mainfont\the\pageno\eightrm\qquad\grouptitle
\hfill\title\qquad\mainfont\topsecno} % top line on left-hand pages
\def\rheader{\headertrue\mainfont\topsecno\eightrm\qquad\title\hfill
Modified: trunk/Build/source/texk/web2c/cwebdir/refsort.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/refsort.ch 2024-09-13 23:42:03 UTC (rev 72277)
+++ trunk/Build/source/texk/web2c/cwebdir/refsort.ch 2024-09-14 13:14:52 UTC (rev 72278)
@@ -45,6 +45,12 @@
item *x, **y;
@z
+ at x [4] l.83
+ @<Copy |buf| to item |x|@>;
+ at y
+ @<Copy \9{b}|buf| to item |x|@>;
+ at z
+
@x [5] l.89 variable not used
{ register int k;
@y
@@ -51,6 +57,12 @@
{
@z
+ at x [6] l.99
+@<Copy |buf|...@>=
+ at y
+@<Copy \9{b}|buf|...@>=
+ at z
+
@x [9] l.149 'register' removed in C++17
{ register int toggle=0;
@y
More information about the tex-live-commits
mailing list.