[latex3-commits] [git/LaTeX3-latex3-latex2e] gh52: fix for #52 (a3056731)

Frank Mittelbach frank.mittelbach at latex-project.org
Fri Nov 29 22:38:56 CET 2019


Repository : https://github.com/latex3/latex2e
On branch  : gh52
Link       : https://github.com/latex3/latex2e/commit/a3056731940d3961a13a50bba85df8ab9a36b8e8

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

commit a3056731940d3961a13a50bba85df8ab9a36b8e8
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Nov 29 22:38:56 2019 +0100

    fix for #52


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

a3056731940d3961a13a50bba85df8ab9a36b8e8
 base/TEMPLATE-IncludeInRelease.txt             |  2 +-
 base/changes.txt                               |  5 +++
 base/doc/ltnews31.tex                          |  2 +
 base/ltclass.dtx                               | 58 ++++++++++++++++++++++++--
 base/testfiles/github-0052.lvt                 | 25 +++++++++++
 base/testfiles/github-0052.tlg                 |  6 +++
 base/testfiles/tlb-latexrelease-003.luatex.tlg |  4 ++
 base/testfiles/tlb-latexrelease-003.tlg        |  4 ++
 base/testfiles/tlb-latexrelease-003.xetex.tlg  |  4 ++
 9 files changed, 105 insertions(+), 5 deletions(-)

diff --git a/base/TEMPLATE-IncludeInRelease.txt b/base/TEMPLATE-IncludeInRelease.txt
index de274a12..006f873a 100644
--- a/base/TEMPLATE-IncludeInRelease.txt
+++ b/base/TEMPLATE-IncludeInRelease.txt
@@ -1,6 +1,6 @@
 %</2ekernel>
 %<*2ekernel|latexrelease>
-%<latexrelease>\IncludeInRelease{2020/02/01}%
+%<latexrelease>\IncludeInRelease{2020/02/02}%
 %<latexrelease>                 {\XXX}{Info}%
 
 
diff --git a/base/changes.txt b/base/changes.txt
index 6efed2a4..cf55e0b0 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -4,6 +4,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2019-11-29  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltclass.dtx: Be careful when displaying the package or
+	class info text as it may contain UTF-8 chars (gh/52)}
+
 2019-11-22  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltoutenc.dtx (subsection{The fontenc package}):
diff --git a/base/doc/ltnews31.tex b/base/doc/ltnews31.tex
index 2b1eca22..2c2bf663 100644
--- a/base/doc/ltnews31.tex
+++ b/base/doc/ltnews31.tex
@@ -223,6 +223,8 @@ entirely, but to support older formats, this is still recommended at present.
 
 \section{Other changes to the \LaTeX{} kernel}
 
+\emph{fixed gh52}
+
 \emph{fixed gh198}
 
 \emph{fixed gh199}
diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index 9dc65d2b..f5c24a24 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltclass.dtx}
-             [2019/10/18 v1.3d LaTeX Kernel (Class & Package Interface)]
+             [2019/11/29 v1.3e LaTeX Kernel (Class & Package Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltclass.dtx}
@@ -791,19 +791,69 @@
   \@ifnextchar[\@pr at videpackage{\@pr at videpackage[]}}%]
 \@onlypreamble\ProvidesPackage
 %    \end{macrocode}
+%  \end{macro}
+%
 %
+%
+%  \begin{macro}{\@pr at videpackage}
+%    This is the helper command for \cs{ProvidesPackage}. It tries to
+%    be cautious when handling the identification string in case it
+%    contains UTF-8 characters.
+% \changes{v1.3e}{2019/11/29}{Protect package info text (gh/52)}
 %    \begin{macrocode}
+%</2ekernel>
+%<*2ekernel|latexrelease>
+%<latexrelease>\IncludeInRelease{2020/02/02}%
+%<latexrelease>                 {\@pr at videpackage}{Protection for package info}%
 \def\@pr at videpackage[#1]{%
-  \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}%
+  \expandafter\protected at xdef                %     <-- protected...
+     \csname ver@\@currname.\@currext\endcsname{#1}%
   \ifx\@currext\@clsextension
     \typeout{Document Class: \@gtempa\space#1}%
   \else
-    \wlog{Package: \@gtempa\space#1}%
+    \protected at wlog{Package: \@gtempa\space#1}%   <--- protected
   \fi}
-\@onlypreamble\@pr at videpackage
 %    \end{macrocode}
 % \end{macro}
 %
+%
+%
+%  \begin{macro}{\protected at wlog}
+%    This is like plain \Tex's \cs{wlog} but gracefully handles
+%    protected commands.
+%    \begin{macrocode}
+\long\def\protected at wlog#1{\begingroup
+  \set at display@protect
+  \immediate \write \m at ne {#1}\endgroup }
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%    \begin{macrocode}
+%</2ekernel|latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<latexrelease>\IncludeInRelease{0000/00/00}%
+%<latexrelease>                 {\@pr at videpackage}{Protection for package info}%
+%<latexrelease>
+%<latexrelease>\def\@pr at videpackage[#1]{%
+%<latexrelease>  \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}%
+%<latexrelease>  \ifx\@currext\@clsextension
+%<latexrelease>    \typeout{Document Class: \@gtempa\space#1}%
+%<latexrelease>  \else
+%<latexrelease>    \wlog{Package: \@gtempa\space#1}%
+%<latexrelease>  \fi}
+%<latexrelease>\let\protected at wlog\@undefined
+%<latexrelease>
+%<latexrelease>\EndIncludeInRelease
+%<*2ekernel>
+%    \end{macrocode}
+%    
+%    \begin{macrocode}
+\@onlypreamble\@pr at videpackage
+%    \end{macrocode}
+%    
+%
+%
 % \begin{macro}{\ProvidesClass}
 %    Like |\ProvidesPackage|, but for classes.
 %    \begin{macrocode}
diff --git a/base/testfiles/github-0052.lvt b/base/testfiles/github-0052.lvt
new file mode 100644
index 00000000..3ef0f352
--- /dev/null
+++ b/base/testfiles/github-0052.lvt
@@ -0,0 +1,25 @@
+
+\documentclass{article}
+
+\begin{filecontents}{\jobname-test.sty}
+\NeedsTeXFormat{LaTeX2e}%
+
+\ProvidesPackage{\jobname-test}[2018/03/10 1.1 Teckids Teχ/LᴬTᴇX style]%
+
+\typeout{Everything fine}
+\end{filecontents}
+
+\input{test2e}
+
+\START
+
+\usepackage{\jobname-test}
+
+\OMIT
+\begin{document}
+\TIMO
+
+foo
+
+\END
+
diff --git a/base/testfiles/github-0052.tlg b/base/testfiles/github-0052.tlg
new file mode 100644
index 00000000..5b2fd6e1
--- /dev/null
+++ b/base/testfiles/github-0052.tlg
@@ -0,0 +1,6 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+(github-0052-test.sty
+Package: github-0052-test ....-..-.. 1.1 Teckids Te^^cf^^87/L^^e1^^b4^^acT^^e1^^b4^^87X style
+Everything fine
+)
diff --git a/base/testfiles/tlb-latexrelease-003.luatex.tlg b/base/testfiles/tlb-latexrelease-003.luatex.tlg
index f817eb7a..8998a3ea 100644
--- a/base/testfiles/tlb-latexrelease-003.luatex.tlg
+++ b/base/testfiles/tlb-latexrelease-003.luatex.tlg
@@ -126,6 +126,8 @@ Skipping: [....-..-..] Guard against bad input on input line ....
 Applying: [....-..-..] Guard against bad input on input line ....
 Skipping: [....-..-..] Spaces in option clash check on input line ....
 Applying: [....-..-..] Spaces in option clash check on input line ....
+Skipping: [....-..-..] Protection for package info on input line ....
+Applying: [....-..-..] Protection for package info on input line ....
 Skipping: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Applying: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Skipping: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
@@ -424,6 +426,8 @@ Applying: [....-..-..] Guard against bad input on input line ....
 Already applied: [....-..-..] Guard against bad input on input line ....
 Applying: [....-..-..] Spaces in option clash check on input line ....
 Already applied: [....-..-..] Spaces in option clash check on input line ...
+Skipping: [....-..-..] Protection for package info on input line ....
+Applying: [....-..-..] Protection for package info on input line ....
 Applying: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Already applied: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
diff --git a/base/testfiles/tlb-latexrelease-003.tlg b/base/testfiles/tlb-latexrelease-003.tlg
index 469e5d9b..fd942350 100644
--- a/base/testfiles/tlb-latexrelease-003.tlg
+++ b/base/testfiles/tlb-latexrelease-003.tlg
@@ -124,6 +124,8 @@ Skipping: [....-..-..] Guard against bad input on input line ....
 Applying: [....-..-..] Guard against bad input on input line ....
 Skipping: [....-..-..] Spaces in option clash check on input line ....
 Applying: [....-..-..] Spaces in option clash check on input line ....
+Skipping: [....-..-..] Protection for package info on input line ....
+Applying: [....-..-..] Protection for package info on input line ....
 Skipping: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Applying: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Skipping: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
@@ -416,6 +418,8 @@ Applying: [....-..-..] Guard against bad input on input line ....
 Already applied: [....-..-..] Guard against bad input on input line ....
 Applying: [....-..-..] Spaces in option clash check on input line ....
 Already applied: [....-..-..] Spaces in option clash check on input line ...
+Skipping: [....-..-..] Protection for package info on input line ....
+Applying: [....-..-..] Protection for package info on input line ....
 Applying: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Already applied: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
diff --git a/base/testfiles/tlb-latexrelease-003.xetex.tlg b/base/testfiles/tlb-latexrelease-003.xetex.tlg
index af1804fe..8923626e 100644
--- a/base/testfiles/tlb-latexrelease-003.xetex.tlg
+++ b/base/testfiles/tlb-latexrelease-003.xetex.tlg
@@ -124,6 +124,8 @@ Skipping: [....-..-..] Guard against bad input on input line ....
 Applying: [....-..-..] Guard against bad input on input line ....
 Skipping: [....-..-..] Spaces in option clash check on input line ....
 Applying: [....-..-..] Spaces in option clash check on input line ....
+Skipping: [....-..-..] Protection for package info on input line ....
+Applying: [....-..-..] Protection for package info on input line ....
 Skipping: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Applying: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Skipping: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....
@@ -425,6 +427,8 @@ Applying: [....-..-..] Guard against bad input on input line ....
 Already applied: [....-..-..] Guard against bad input on input line ....
 Applying: [....-..-..] Spaces in option clash check on input line ....
 Already applied: [....-..-..] Spaces in option clash check on input line ...
+Skipping: [....-..-..] Protection for package info on input line ....
+Applying: [....-..-..] Protection for package info on input line ....
 Applying: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Already applied: [....-..-..] Spaces in \ExecuteOptions  on input line ....
 Applying: [....-..-..] ifx tests in \@fileswith at pti@ns  on input line ....





More information about the latex3-commits mailing list