[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: fix for #256 (8546d540)

Frank Mittelbach frank.mittelbach at latex-project.org
Tue Jan 28 11:21:58 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/8546d54095d8d2b75a48484f86d3eb05f0c82575

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

commit 8546d54095d8d2b75a48484f86d3eb05f0c82575
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Tue Jan 28 11:21:58 2020 +0100

    fix for #256


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

8546d54095d8d2b75a48484f86d3eb05f0c82575
 base/changes.txt                      |  6 ++++++
 base/doc/ltnews31.tex                 |  8 ++++++--
 base/ltclass.dtx                      | 13 +++++++-----
 base/testfiles/github-0256.luatex.tlg | 15 ++++++++++++++
 base/testfiles/github-0256.lvt        | 37 +++++++++++++++++++++++++++++++++++
 base/testfiles/github-0256.tlg        | 13 ++++++++++++
 6 files changed, 85 insertions(+), 7 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 90ad3d5d..21b91091 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -8,6 +8,12 @@ are not part of the distribution.
 # 2020-02-02 Release
 #########################
 
+2020-01-28  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltclass.dtx (subsection{Providing shipment}):
+	Allow spaces in option string and display
+	only unknown options not the whole option list (gh/256)
+
 2020-01-27  David Carlisle  <David.Carlisle at latex-project.org>
 
 	* ltclass.dtx: Fix text of error message in filecontents
diff --git a/base/doc/ltnews31.tex b/base/doc/ltnews31.tex
index 830a5e2e..3ee9efa3 100644
--- a/base/doc/ltnews31.tex
+++ b/base/doc/ltnews31.tex
@@ -571,10 +571,15 @@ open write streams, and when those have been used up, then
 will fail.
 In \LuaTeX{} more write streams are available and those can
 also now be utilised.
-%% CAR word removed for better breaks
 %
 \githubissue{238}
 
+\subsection{Allow spaces in \texttt{filecontents} option list}
+
+Leaving spaces or newlines in the option list prevented the options
+from being correctly recognized. This has been corrected.
+%
+\githubissue{256}
 
 
 
@@ -650,7 +655,6 @@ A number of these additional primitives are needed to support new or improved
 functionality in \LaTeX{}. This is seen for example in the improved UTF-8 handling,
 which uses \cs{ifincsname}. The following primitive
 functionality (which in \LuaTeX{} may be achieved using Lua code)
-\pagebreak
 will therefore be \emph{required} by the \LaTeX{} kernel and core\\
 packages from the start of 2021:
 %
diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index de11ee8c..9e7668e8 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltclass.dtx}
-             [2020/01/27 v1.3g LaTeX Kernel (Class & Package Interface)]
+             [2020/01/28 v1.3h LaTeX Kernel (Class & Package Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltclass.dtx}
@@ -1802,13 +1802,16 @@
 %    To handle the optional argument we execute for each option the
 %    command \cs{filec at ntents@OPTION} if it exist or complain about
 %    unknown option.
+% \changes{v1.3h}{2020/01/28}{Allow spaces in option string and display
+%     only unknown options not the whole option list (gh/256)}
 %    \begin{macrocode}
 \def\filec at ntents@opt[#1]{%
-  \@for\@tempa:=#1\do{%
-    \ifcsname filec at ntents@\@tempa\endcsname
-      \csname filec at ntents@\@tempa\endcsname
+  \edef\@fortmp{\zap at space#1 \@empty}%
+  \@for\@reserveda:=\@fortmp\do{%
+    \ifcsname filec at ntents@\@reserveda\endcsname
+      \csname filec at ntents@\@reserveda\endcsname
     \else
-    \@latex at error{Unknown filecontents option #1}%
+    \@latex at error{Unknown filecontents option \@reserveda}%
        {Valid options are force (or overwrite), nosearch, noheader}%
     \fi}%
   \filec at ntents
diff --git a/base/testfiles/github-0256.luatex.tlg b/base/testfiles/github-0256.luatex.tlg
new file mode 100644
index 00000000..1384da8d
--- /dev/null
+++ b/base/testfiles/github-0256.luatex.tlg
@@ -0,0 +1,15 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+! LaTeX Error: Unknown filecontents option UNKNOWN.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ......{filecontents}[overwrite, noheader, UNKNOWN]
+                                                  {\jobname.xxx}
+Valid options are force (or overwrite), nosearch, noheader
+LaTeX Warning: Writing or overwriting file `./github-0256.xxx'.
+\openout127 = github-0256.xxx
+First line: hello = Hello?
+LaTeX Warning: Writing or overwriting file `././github-0256.xxx'.
+\openout127 = github-0256.xxx
+First line: %% LaTeX2e file `./github-0256.xxx' = some comment line?
diff --git a/base/testfiles/github-0256.lvt b/base/testfiles/github-0256.lvt
new file mode 100644
index 00000000..20b586d0
--- /dev/null
+++ b/base/testfiles/github-0256.lvt
@@ -0,0 +1,37 @@
+\documentclass{article}
+
+\input{test2e}
+
+\newread\xxx
+
+\begin{document} 
+
+\START
+
+\begin{filecontents}[overwrite, noheader, UNKNOWN]{\jobname.xxx}
+hello
+\end{filecontents}
+
+\catcode`\%=12  % show lines with percent
+
+\immediate\openin\xxx \jobname.xxx
+
+\read\xxx to \foo
+\typeout{First line: \foo = Hello?} 
+
+\immediate\closein\xxx
+
+
+\begin{filecontents}[ overwrite ,
+                      nosearch ]{\jobname.xxx}
+hello
+\end{filecontents}
+
+
+\immediate\openin\xxx \jobname.xxx
+
+\read\xxx to \foo
+\typeout{First line: \foo = some comment line?} 
+
+\END
+
diff --git a/base/testfiles/github-0256.tlg b/base/testfiles/github-0256.tlg
new file mode 100644
index 00000000..3bb4b2cb
--- /dev/null
+++ b/base/testfiles/github-0256.tlg
@@ -0,0 +1,13 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+! LaTeX Error: Unknown filecontents option UNKNOWN.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ......ilecontents}[overwrite, noheader, UNKNOWN]
+                                                  {\jobname.xxx}
+Valid options are force (or overwrite), nosearch, noheader
+LaTeX Warning: Writing or overwriting file `./github-0256.xxx'.
+First line: hello = Hello?
+LaTeX Warning: Writing or overwriting file `././github-0256.xxx'.
+First line: %% LaTeX2e file `./github-0256.xxx' = some comment line?





More information about the latex3-commits mailing list.