[latex3-commits] [git/LaTeX3-latex3-latex2e] para-issue: experimental fix for strance error caused by listings redefining \vskip (91126d9e)
Frank Mittelbach
frank.mittelbach at latex-project.org
Sun Jun 27 19:13:03 CEST 2021
Repository : https://github.com/latex3/latex2e
On branch : para-issue
Link : https://github.com/latex3/latex2e/commit/91126d9eddd7e8dd2db43d673be16ba89be0e486
>---------------------------------------------------------------
commit 91126d9eddd7e8dd2db43d673be16ba89be0e486
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Sun Jun 27 19:13:03 2021 +0200
experimental fix for strance error caused by listings redefining \vskip
>---------------------------------------------------------------
91126d9eddd7e8dd2db43d673be16ba89be0e486
base/ltpara.dtx | 28 ++++++++++++++++++++++++++--
base/testfiles/tlb0406.luatex.tlg | 2 +-
base/testfiles/tlb0406.tlg | 2 +-
base/testfiles/tlb0942.luatex.tlg | 2 +-
base/testfiles/tlb0942.tlg | 2 +-
base/testfiles/tlb2558.luatex.tlg | 2 +-
base/testfiles/tlb2558.tlg | 2 +-
base/testfiles/tlb2558.xetex.tlg | 2 +-
8 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/base/ltpara.dtx b/base/ltpara.dtx
index 5ab52a5e..5ebecffe 100644
--- a/base/ltpara.dtx
+++ b/base/ltpara.dtx
@@ -14,8 +14,8 @@
%%% From File: ltpara.dtx
%
% \begin{macrocode}
-\def\ltparaversion{v1.0g}
-\def\ltparadate{2021/05/27}
+\def\ltparaversion{v1.0h}
+\def\ltparadate{2021/06/27}
% \end{macrocode}
%<*driver>
\documentclass{l3doc}
@@ -972,6 +972,30 @@
% above construct but two conditionals instead. Using low-level
% \cs{if_mode...} conditions would be even faster but has the
% danger to conflict with conditionals in the user hooks.
+%
+% If \cs{para_end:} is executed while \TeX{} is currently doing a
+% low-level assignment the test for horizontal mode may get
+% executed as part of the assignment. That is normally not an issue
+% but we just found one case where it is:
+%\begin{verbatim}
+% \afterassignment\lst at vskip\@tempskipa \z@ \par
+%\end{verbatim}
+% If \TeX{} is in hmode while that assignment happens then the
+% \cs{par} is seen in hmode (because in the above case the
+% assignment isn't finished (one should have used \cs{z at skip} and
+% the \cs{lst at vskip} will get inserted into the middle of the
+% conditional. The \cs{lst at vskip} then changes to vmode and you get
+% a surprising error about the \texttt{para/end} hook having
+% changed modes even if you don't have any hook code because it is
+% the instered \cs{lst at vskip} that is causing it. That happened
+% when the output routines got started while a \texttt{lstlisting}
+% environment (that redefines \cs{vskip} in this way) was was
+% active. This is really faulty coding, but we try to be proactive
+% and guard the conditional so thatany scanning is stopped before it:
+% \begin{macrocode}
+ \scan_stop:
+% \end{macrocode}
+%
% \begin{macrocode}
\mode_if_horizontal:TF {
\mode_if_inner:F {
diff --git a/base/testfiles/tlb0406.luatex.tlg b/base/testfiles/tlb0406.luatex.tlg
index ad3fef19..ebd0e376 100644
--- a/base/testfiles/tlb0406.luatex.tlg
+++ b/base/testfiles/tlb0406.luatex.tlg
@@ -17,5 +17,5 @@ l. ...\DeclareMathSymbol{a}{7}{operators}{`\a}
l. ...\DeclareMathSymbol{a}{7}{letters}{`\a}
> 31457377.
<to be read again>
-\tex_par:D
+\scan_stop:
l. ...
diff --git a/base/testfiles/tlb0406.tlg b/base/testfiles/tlb0406.tlg
index 9f32b6aa..8569f0f1 100644
--- a/base/testfiles/tlb0406.tlg
+++ b/base/testfiles/tlb0406.tlg
@@ -17,5 +17,5 @@ l. ...\DeclareMathSymbol{a}{7}{operators}{`\a}
l. ...\DeclareMathSymbol{a}{7}{letters}{`\a}
> 29025.
<to be read again>
- \tex_par:D
+ \scan_stop:
l. ...
diff --git a/base/testfiles/tlb0942.luatex.tlg b/base/testfiles/tlb0942.luatex.tlg
index b1e0a6be..119e2573 100644
--- a/base/testfiles/tlb0942.luatex.tlg
+++ b/base/testfiles/tlb0942.luatex.tlg
@@ -737,5 +737,5 @@ l. ...\showthe
\mathcode`\z
> 31457402.
<to be read again>
-\tex_par:D
+\scan_stop:
l. ...
diff --git a/base/testfiles/tlb0942.tlg b/base/testfiles/tlb0942.tlg
index 3ffcf8a2..7f770986 100644
--- a/base/testfiles/tlb0942.tlg
+++ b/base/testfiles/tlb0942.tlg
@@ -737,5 +737,5 @@ l. ...\showthe
\mathcode`\z
> 29050.
<to be read again>
- \tex_par:D
+ \scan_stop:
l. ...
diff --git a/base/testfiles/tlb2558.luatex.tlg b/base/testfiles/tlb2558.luatex.tlg
index c9e33292..22b39a06 100644
--- a/base/testfiles/tlb2558.luatex.tlg
+++ b/base/testfiles/tlb2558.luatex.tlg
@@ -25,7 +25,7 @@ For xelatex or lualatex save the document in UTF-8 encoding
and do not use inputenc, or use the [utf8] option.
> 11.
<to be read again>
-\tex_par:D
+\scan_stop:
l. ...
! Package inputenc Error: inputenc is not designed for xetex or luatex.
(inputenc) only UTF-8 supported.
diff --git a/base/testfiles/tlb2558.tlg b/base/testfiles/tlb2558.tlg
index 4a72c80b..ff25753e 100644
--- a/base/testfiles/tlb2558.tlg
+++ b/base/testfiles/tlb2558.tlg
@@ -20,7 +20,7 @@ File: latin1.def ....-..-.. v... Input encoding file
)
> 11.
<to be read again>
- \tex_par:D
+ \scan_stop:
l. ...
> 12.
l. ...\showthe\catcode`\@
diff --git a/base/testfiles/tlb2558.xetex.tlg b/base/testfiles/tlb2558.xetex.tlg
index c4c9554e..6aa88e2c 100644
--- a/base/testfiles/tlb2558.xetex.tlg
+++ b/base/testfiles/tlb2558.xetex.tlg
@@ -25,7 +25,7 @@ For xelatex or lualatex save the document in UTF-8 encoding
and do not use inputenc, or use the [utf8] option.
> 11.
<to be read again>
- \tex_par:D
+ \scan_stop:
l. ...
! Package inputenc Error: inputenc is not designed for xetex or luatex.
(inputenc) only UTF-8 supported.
More information about the latex3-commits
mailing list.