Skip to content

Commit

Permalink
experimental fix for strance error caused by listings redefining \vskip
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed Jun 27, 2021
1 parent 7496274 commit 91126d9
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 9 deletions.
28 changes: 26 additions & 2 deletions base/ltpara.dtx
Expand Up @@ -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}
Expand Down Expand Up @@ -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@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@skip} and
% the \cs{lst@vskip} will get inserted into the middle of the
% conditional. The \cs{lst@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@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 {
Expand Down
2 changes: 1 addition & 1 deletion base/testfiles/tlb0406.luatex.tlg
Expand Up @@ -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. ...
2 changes: 1 addition & 1 deletion base/testfiles/tlb0406.tlg
Expand Up @@ -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. ...
2 changes: 1 addition & 1 deletion base/testfiles/tlb0942.luatex.tlg
Expand Up @@ -737,5 +737,5 @@ l. ...\showthe
\mathcode`\z
> 31457402.
<to be read again>
\tex_par:D
\scan_stop:
l. ...
2 changes: 1 addition & 1 deletion base/testfiles/tlb0942.tlg
Expand Up @@ -737,5 +737,5 @@ l. ...\showthe
\mathcode`\z
> 29050.
<to be read again>
\tex_par:D
\scan_stop:
l. ...
2 changes: 1 addition & 1 deletion base/testfiles/tlb2558.luatex.tlg
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion base/testfiles/tlb2558.tlg
Expand Up @@ -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`\@
Expand Down
2 changes: 1 addition & 1 deletion base/testfiles/tlb2558.xetex.tlg
Expand Up @@ -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.
Expand Down

0 comments on commit 91126d9

Please sign in to comment.