[latex3-commits] [git/LaTeX3-latex3-latex2e] gh220: Update changes.txt, ltclass.dtx, and 6 more files... for a change in the definition of \filec at ntents (7efc616d)

Johannes Braams texniek at braams.xs4all.nl
Sat Aug 8 18:25:04 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : gh220
Link       : https://github.com/latex3/latex2e/commit/7efc616dfadc5df0c10269f331d8cea850d2ab9a

>---------------------------------------------------------------

commit 7efc616dfadc5df0c10269f331d8cea850d2ab9a
Author: Johannes Braams <texniek at braams.xs4all.nl>
Date:   Sat Aug 8 18:25:04 2020 +0200

    Update changes.txt, ltclass.dtx, and 6 more files... for a change in the definition of \filec at ntents


>---------------------------------------------------------------

7efc616dfadc5df0c10269f331d8cea850d2ab9a
 base/changes.txt                                   |   6 +-
 base/ltclass.dtx                                   | 146 ++++++++++++++++++++-
 .../tlb-latexrelease-rollback-003-often.luatex.tlg |   2 +
 .../tlb-latexrelease-rollback-003-often.tlg        |   2 +
 .../tlb-latexrelease-rollback-003-often.xetex.tlg  |   2 +
 base/testfiles/tlb-rollback-004-often.luatex.tlg   |   1 +
 base/testfiles/tlb-rollback-004-often.tlg          |   1 +
 base/testfiles/tlb-rollback-004-often.xetex.tlg    |   1 +
 8 files changed, 153 insertions(+), 8 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 6978eb7d..241531af 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -1,4 +1,3 @@
-
 ================================================================================
 This file lists changes to the LaTeX2e files in reverse chronological order of
 publication (therefore the dates might be out of sequence if there are hotfixes).
@@ -7,6 +6,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2020-08-08  Johannes Braams  <Johannes.Braams at latex-project.org>
+
+	* ltclass.dtx:
+	Small optimisation by defining \q at curr@file directly (gh/220)
+
 2020-08-03  Joseph Wright <joseph.wright at latex-project.org>
 
 	* ltluatex.dtx:
diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index 152adf82..1b7d9e83 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltclass.dtx}
-             [2020/06/05 v1.3l LaTeX Kernel (Class & Package Interface)]
+             [2020-08-08 v1.3m LaTeX Kernel (Class & Package Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltclass.dtx}
@@ -1846,7 +1846,7 @@
 %
 % \subsection{Hooks}
 %
-% Allow code do be saved to be executed at specific later times.
+% Allow code to be saved to be executed at specific later times.
 %
 % Save things in macros, I considered using toks registers, (and
 % |\addto at hook| from the NFSS code, that would require stacking the
@@ -2036,8 +2036,8 @@
 %    \begin{macrocode}
 %</2ekernel>
 %<*2ekernel|latexrelease>
-%<latexrelease>\IncludeInRelease{2019/10/01}%
-%<latexrelease>                 {\filec at ntents}{Spaces in file names + optional arg}%
+%<latexrelease>\IncludeInRelease{2020/10/01}%
+%<latexrelease>                 {\filec at ntents}{Define \q at curr@file directly (gh/220)}%
 %
 %    \end{macrocode}
 %    We use |@tempswa| to mean no preamble writing and reuse |@filesw|
@@ -2080,7 +2080,7 @@
 \let\filec at ntents@noheader\@tempswafalse
 %    \end{macrocode}
 %    Option \texttt{nosearch} only checks the current directory not
-%    the how \TeX{} tree for the existence of the file to write.
+%    the whole \TeX{} tree for the existence of the file to write.
 %    \begin{macrocode}
 \def\filec at ntents@nosearch{%
   \let\filec at ntents@checkdir\@currdir
@@ -2106,10 +2106,12 @@
 \catcode`\^^I\active%
 %    \end{macrocode}
 %
+% \changes{v1.3m}{2020-08-08}{define \cs{q at curr@file} directly as the
+%    quotes have already been removed (gh/220)} 
 %    \begin{macrocode}
 \gdef\filec at ntents#1{%
   \set at curr@file{\filec at ntents@checkdir#1}%
-  \edef\q at curr@file{\expandafter\quote at name\expandafter{\@curr at file}}%
+  \edef\q at curr@file{"\@curr at file"}%
 %    \end{macrocode}
 %
 % Lua\TeX\ has more writes (and 18 is safe here).
@@ -2270,6 +2272,136 @@
 %    \begin{macrocode}
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{2019/10/01}%
+%<latexrelease>                 {\filec at ntents}{Spaces in file names + optional arg}%
+%<latexrelease>\def\filecontents{\@tempswatrue\@fileswtrue
+%<latexrelease>  \@ifnextchar[\filec at ntents@opt\filec at ntents
+%<latexrelease>}
+%<latexrelease>\@namedef{filecontents*}{\@tempswafalse\@fileswtrue
+%<latexrelease>  \@ifnextchar[\filec at ntents@opt\filec at ntents
+%<latexrelease>}
+%<latexrelease>\def\filec at ntents@opt[#1]{%
+%<latexrelease>  \edef\@fortmp{\zap at space#1 \@empty}%
+%<latexrelease>  \@for\reserved at a:=\@fortmp\do{%
+%<latexrelease>    \ifcsname filec at ntents@\reserved at a\endcsname
+%<latexrelease>      \csname filec at ntents@\reserved at a\endcsname
+%<latexrelease>    \else
+%<latexrelease>    \@latex at error{Unknown filecontents option \reserved at a}%
+%<latexrelease>       {Valid options are force (or overwrite), nosearch, noheader}%
+%<latexrelease>    \fi}%
+%<latexrelease>  \filec at ntents
+%<latexrelease>}
+%<latexrelease>\let\filec at ntents@force\@fileswfalse
+%<latexrelease>\let\filec at ntents@overwrite\@fileswfalse  % alternative name
+%<latexrelease>\let\filec at ntents@noheader\@tempswafalse
+%<latexrelease>\def\filec at ntents@nosearch{%
+%<latexrelease>  \let\filec at ntents@checkdir\@currdir
+%<latexrelease>  \def\filec at ntents@where{in current directory}}
+%<latexrelease>\let\filec at ntents@checkdir\@empty
+%<latexrelease>\def\filec at ntents@where{exists on the system}
+%<latexrelease>\begingroup%
+%<latexrelease>\@tempcnta=1
+%<latexrelease>\loop
+%<latexrelease>  \catcode\@tempcnta=12  %
+%<latexrelease>  \advance\@tempcnta\@ne %
+%<latexrelease>\ifnum\@tempcnta<32      %
+%<latexrelease>\repeat                  %
+%<latexrelease>\catcode`\*=11 %
+%<latexrelease>\catcode`\^^M\active%
+%<latexrelease>\catcode`\^^L\active\let^^L\relax%
+%<latexrelease>\catcode`\^^I\active%
+%<latexrelease>\gdef\filec at ntents#1{%
+%<latexrelease>  \set at curr@file{\filec at ntents@checkdir#1}%
+%<latexrelease>  \edef\q at curr@file{\expandafter\quote at name\expandafter{\@curr at file}}%
+%<latexrelease>  \chardef\reserved at c\ifx\directlua\@undefined 15 \else 127 \fi%
+%<latexrelease>  \openin\@inputcheck\q at curr@file \space %
+%<latexrelease>  \ifeof\@inputcheck%
+%<latexrelease>    \@latex at warning@no at line%
+%<latexrelease>        {Writing file `\@currdir\@curr at file'}%
+%<latexrelease>    \ch at ck7\reserved at c\write\relax%
+%<latexrelease>    \immediate\openout\reserved at c\q at curr@file\relax%
+%<latexrelease>  \else%
+%<latexrelease>    \if at filesw%
+%<latexrelease>      \@latex at warning@no at line%
+%<latexrelease>          {File `\@curr at file' already \filec at ntents@where.\MessageBreak%
+%<latexrelease>             Not generating it from this source}%
+%<latexrelease>      \let\write\@gobbletwo%
+%<latexrelease>      \let\closeout\@gobble%
+%<latexrelease>    \else%
+%<latexrelease>      \edef\reserved at a{#1}%
+%<latexrelease>      \edef\reserved at a{\detokenize\expandafter{\reserved at a}}%
+%<latexrelease>      \edef\reserved at b{\detokenize\expandafter{\jobname}}%
+%<latexrelease>      \ifx\reserved at a\reserved at b%
+%<latexrelease>        \@fileswtrue%
+%<latexrelease>      \else%
+%<latexrelease>        \edef\reserved at b{\reserved at b\detokenize{.tex}}%
+%<latexrelease>        \ifx\reserved at a\reserved at b
+%<latexrelease>          \@fileswtrue%
+%<latexrelease>        \fi%
+%<latexrelease>      \fi%
+%<latexrelease>      \ch at ck7\reserved at c\write\relax%
+%<latexrelease>      \if at filesw%  % Foul ... trying to overwrite \jobname!
+%<latexrelease>      \@latex at error{Trying to overwrite `\jobname.tex'}{You can't %
+%<latexrelease>        write to the file you are reading from!\MessageBreak%
+%<latexrelease>        Data is written to screen instead.}%
+%<latexrelease>      \else%
+%<latexrelease>        \@latex at warning@no at line%
+%<latexrelease>           {Writing or overwriting file `\@currdir\@curr at file'}%
+%<latexrelease>        \immediate\openout\reserved at c\q at curr@file\relax%
+%<latexrelease>      \fi%
+%<latexrelease>    \fi%
+%<latexrelease>  \fi%
+%<latexrelease>  \closein\@inputcheck%
+%<latexrelease>  \if at tempswa%
+%<latexrelease>    \immediate\write\reserved at c{%
+%<latexrelease>      \@percentchar\@percentchar\space%
+%<latexrelease>          \expandafter\@gobble\string\LaTeX2e file `\@curr at file'^^J%
+%<latexrelease>      \@percentchar\@percentchar\space  generated by the %
+%<latexrelease>        `\@currenvir' \expandafter\@gobblefour\string\newenvironment^^J%
+%<latexrelease>      \@percentchar\@percentchar\space from source `\jobname' on %
+%<latexrelease>         \number\year/\two at digits\month/\two at digits\day.^^J%
+%<latexrelease>      \@percentchar\@percentchar}%
+%<latexrelease>  \fi%
+%<latexrelease>  \let\do\@makeother\dospecials%
+%<latexrelease>  \count@ 128\relax%
+%<latexrelease>  \loop%
+%<latexrelease>    \catcode\count@ 11\relax%
+%<latexrelease>    \advance\count@ \@ne%
+%<latexrelease>    \ifnum\count@<\@cclvi%
+%<latexrelease>  \repeat%
+%<latexrelease>  \edef\E{\@backslashchar end\string{\@currenvir\string}}%
+%<latexrelease>  \edef\reserved at b{%
+%<latexrelease>    \def\noexpand\reserved at b%
+%<latexrelease>         ####1\E####2\E####3\relax}%
+%<latexrelease>  \reserved at b{%
+%<latexrelease>    \ifx\relax##3\relax%
+%<latexrelease>      \immediate\write\reserved at c{##1}%
+%<latexrelease>    \else%
+%<latexrelease>      \edef^^M{\noexpand\end{\@currenvir}}%
+%<latexrelease>      \ifx\relax##1\relax%
+%<latexrelease>      \else%
+%<latexrelease>          \@latex at warning{Writing text `##1' before %
+%<latexrelease>             \string\end{\@currenvir}\MessageBreak as last line of \@curr at file}%
+%<latexrelease>        \immediate\write\reserved at c{##1}%
+%<latexrelease>      \fi%
+%<latexrelease>      \ifx\relax##2\relax%
+%<latexrelease>      \else%
+%<latexrelease>         \@latex at warning{%
+%<latexrelease>           Ignoring text `##2' after \string\end{\@currenvir}}%
+%<latexrelease>      \fi%
+%<latexrelease>    \fi%
+%<latexrelease>    ^^M}%
+%<latexrelease>  \catcode`\^^L\active%
+%<latexrelease>  \let\L\@undefined%
+%<latexrelease>  \def^^L{\expandafter\ifx\csname L\endcsname\relax\fi ^^J^^J}%
+%<latexrelease>  \catcode`\^^I\active%
+%<latexrelease>  \let\I\@undefined%
+%<latexrelease>  \def^^I{\expandafter\ifx\csname I\endcsname\relax\fi\space}%
+%<latexrelease>  \catcode`\^^M\active%
+%<latexrelease>  \edef^^M##1^^M{%
+%<latexrelease>    \noexpand\reserved at b##1\E\E\relax}}%
+%<latexrelease>\endgroup%
+%<latexrelease>\EndIncludeInRelease
 %<latexrelease>\IncludeInRelease{0000/00/00}%
 %<latexrelease>                 {\filec at ntents}{Spaces in file names + optional arg}%
 %<latexrelease>
@@ -3015,7 +3147,7 @@
 %<*afterpreamble>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{pkgindoc}
-         [1994/10/20 v1.1 Package Interface in Document (DPC)]
+         [2020-08-08 v1.3m Package Interface in Document (DPC)]
 \def\reserved at a#1\do\@classoptionslist#2\do\filec at ntents#3\relax{%
   \gdef\@preamblecmds{#1#3}}
 \expandafter\reserved at a\@preamblecmds\relax
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
index 7300dc00..8f3e088d 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.luatex.tlg
@@ -169,6 +169,7 @@ Skipping: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Skipping: [....-..-..] Unused options issue on input line ....
 Applying: [....-..-..] Unused options issue on input line ....
+Skipping: [....-..-..] Define \q at curr@file directly (gh/220) on input line ....
 Skipping: [....-..-..] Spaces in file names + optional arg on input line ...
 Applying: [....-..-..] Spaces in file names + optional arg on input line ...
 Skipping: [....-..-..] Make commands robust on input line ....
@@ -568,6 +569,7 @@ Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Already applied: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Skipping: [....-..-..] Unused options issue on input line ....
 Applying: [....-..-..] Unused options issue on input line ....
+Skipping: [....-..-..] Define \q at curr@file directly (gh/220) on input line ....
 Applying: [....-..-..] Spaces in file names + optional arg on input line ...
 Already applied: [....-..-..] Spaces in file names + optional arg on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
index 0f236033..7479c853 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.tlg
@@ -167,6 +167,7 @@ Skipping: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Skipping: [....-..-..] Unused options issue on input line ....
 Applying: [....-..-..] Unused options issue on input line ....
+Skipping: [....-..-..] Define \q at curr@file directly (gh/220) on input line ....
 Skipping: [....-..-..] Spaces in file names + optional arg on input line ...
 Applying: [....-..-..] Spaces in file names + optional arg on input line ...
 Skipping: [....-..-..] Make commands robust on input line ....
@@ -560,6 +561,7 @@ Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Already applied: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Skipping: [....-..-..] Unused options issue on input line ....
 Applying: [....-..-..] Unused options issue on input line ....
+Skipping: [....-..-..] Define \q at curr@file directly (gh/220) on input line ....
 Applying: [....-..-..] Spaces in file names + optional arg on input line ...
 Already applied: [....-..-..] Spaces in file names + optional arg on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
diff --git a/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg b/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
index f9032447..3b744816 100644
--- a/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-rollback-003-often.xetex.tlg
@@ -167,6 +167,7 @@ Skipping: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Skipping: [....-..-..] Unused options issue on input line ....
 Applying: [....-..-..] Unused options issue on input line ....
+Skipping: [....-..-..] Define \q at curr@file directly (gh/220) on input line ....
 Skipping: [....-..-..] Spaces in file names + optional arg on input line ...
 Applying: [....-..-..] Spaces in file names + optional arg on input line ...
 Skipping: [....-..-..] Make commands robust on input line ....
@@ -569,6 +570,7 @@ Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Already applied: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Skipping: [....-..-..] Unused options issue on input line ....
 Applying: [....-..-..] Unused options issue on input line ....
+Skipping: [....-..-..] Define \q at curr@file directly (gh/220) on input line ....
 Applying: [....-..-..] Spaces in file names + optional arg on input line ...
 Already applied: [....-..-..] Spaces in file names + optional arg on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.luatex.tlg b/base/testfiles/tlb-rollback-004-often.luatex.tlg
index a18466bd..de37dbd1 100644
--- a/base/testfiles/tlb-rollback-004-often.luatex.tlg
+++ b/base/testfiles/tlb-rollback-004-often.luatex.tlg
@@ -262,6 +262,7 @@ Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Already applied: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Skipping: [....-..-..] Unused options issue on input line ....
 Applying: [....-..-..] Unused options issue on input line ....
+Skipping: [....-..-..] Define \q at curr@file directly (gh/220) on input line ....
 Applying: [....-..-..] Spaces in file names + optional arg on input line ...
 Already applied: [....-..-..] Spaces in file names + optional arg on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.tlg b/base/testfiles/tlb-rollback-004-often.tlg
index 6d1533b3..c59bb27a 100644
--- a/base/testfiles/tlb-rollback-004-often.tlg
+++ b/base/testfiles/tlb-rollback-004-often.tlg
@@ -260,6 +260,7 @@ Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Already applied: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Skipping: [....-..-..] Unused options issue on input line ....
 Applying: [....-..-..] Unused options issue on input line ....
+Skipping: [....-..-..] Define \q at curr@file directly (gh/220) on input line ....
 Applying: [....-..-..] Spaces in file names + optional arg on input line ...
 Already applied: [....-..-..] Spaces in file names + optional arg on input line ....
 Applying: [....-..-..] Make commands robust on input line ....
diff --git a/base/testfiles/tlb-rollback-004-often.xetex.tlg b/base/testfiles/tlb-rollback-004-often.xetex.tlg
index 0ee3f31e..fb5d8e62 100644
--- a/base/testfiles/tlb-rollback-004-often.xetex.tlg
+++ b/base/testfiles/tlb-rollback-004-often.xetex.tlg
@@ -260,6 +260,7 @@ Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Already applied: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
 Skipping: [....-..-..] Unused options issue on input line ....
 Applying: [....-..-..] Unused options issue on input line ....
+Skipping: [....-..-..] Define \q at curr@file directly (gh/220) on input line ....
 Applying: [....-..-..] Spaces in file names + optional arg on input line ...
 Already applied: [....-..-..] Spaces in file names + optional arg on input line ....
 Applying: [....-..-..] Make commands robust on input line ....





More information about the latex3-commits mailing list.