[latex3-commits] [latex3/latex2e] develop, gh1182: fix for #1182 (5064cfc9)
github at latex-project.org
github at latex-project.org
Thu Nov 16 11:22:24 CET 2023
Repository : https://github.com/latex3/latex2e
On branches: develop,gh1182
Link : https://github.com/latex3/latex2e/commit/5064cfc98a1b3a2dd01bfb45709974e08a8a9972
>---------------------------------------------------------------
commit 5064cfc98a1b3a2dd01bfb45709974e08a8a9972
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Thu Nov 16 11:22:24 2023 +0100
fix for #1182
>---------------------------------------------------------------
5064cfc98a1b3a2dd01bfb45709974e08a8a9972
base/changes.txt | 4 ++++
base/ltpara.dtx | 10 ++++++----
base/testfiles-lthooks2/ltpara-002.lvt | 4 ++--
base/testfiles-lthooks2/ltpara-002.tlg | 4 ++--
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/base/changes.txt b/base/changes.txt
index 51e856dd..c1024ea9 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,10 @@ to completeness or accuracy and it contains some references to files that are
not part of the distribution.
================================================================================
+2023-11-16 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+ * ltpara.dtx (subsection{Providing hooks for paragraphs}):
+ Correct error message: hook left horizontal not vertical mode (gh/1182)
+
2023-11-09 Yukai Chou <muzimuzhi at gmail.com>
* clsguide-historic.tex, usrguide.tex:
Replace quotation with quote envs for zero para indent
diff --git a/base/ltpara.dtx b/base/ltpara.dtx
index 9c1a95ee..480e9c33 100644
--- a/base/ltpara.dtx
+++ b/base/ltpara.dtx
@@ -15,8 +15,8 @@
%%% From File: ltpara.dtx
%
% \begin{macrocode}
-\def\ltparaversion{v1.0l}
-\def\ltparadate{2023/01/30}
+\def\ltparaversion{v1.0m}
+\def\ltparadate{2023/11/16}
% \end{macrocode}
%<*driver>
\documentclass{l3doc}
@@ -811,9 +811,11 @@
\hook_use:n {para/begin}
% \end{macrocode}
% If we aren't in horizontal mode any longer the hooks above misbehaved.
+% \changes{v1.0m}{2023/11/16}{Correct error message: hook
+% left horizontal not vertical mode (gh/1182)}
% \begin{macrocode}
\if_mode_horizontal: \else:
- \msg_error:nnnn { hooks }{ para-mode }{begin}{vertical} \fi:
+ \msg_error:nnnn { hooks }{ para-mode }{begin}{horizontal} \fi:
% \end{macrocode}
% Finally we reinsert the indentation box (unless suppressed) and
% then call \cs{everypar} the way legacy \LaTeX\ code expects it.
@@ -845,7 +847,7 @@
%<latexrelease> \@kernel at before@para at begin
%<latexrelease> \hook_use:n {para/begin}
%<latexrelease> \if_mode_horizontal: \else:
-%<latexrelease> \msg_error:nnnn { hooks }{ para-mode }{begin}{vertical} \fi:
+%<latexrelease> \msg_error:nnnn { hooks }{ para-mode }{begin}{horizontal} \fi:
%<latexrelease> \@@_handle_indent:
%<latexrelease>}
% \end{macrocode}
diff --git a/base/testfiles-lthooks2/ltpara-002.lvt b/base/testfiles-lthooks2/ltpara-002.lvt
index 1b350d92..abad5d3e 100644
--- a/base/testfiles-lthooks2/ltpara-002.lvt
+++ b/base/testfiles-lthooks2/ltpara-002.lvt
@@ -17,11 +17,11 @@
A para.
- \AddToHookNext{para/begin}{Ohh\par\OmitIndent} % get out again
+ \AddToHookNext{para/begin}{Ohh\par\OmitIndent} % get out again and generate an error
A second para.
-\AddToHookNext{para/end}{Ohh\par} % get out again
+\AddToHookNext{para/end}{Ohh\par} % get out again too early and generate an error
A third para.
diff --git a/base/testfiles-lthooks2/ltpara-002.tlg b/base/testfiles-lthooks2/ltpara-002.tlg
index f95bc852..f60df1a0 100644
--- a/base/testfiles-lthooks2/ltpara-002.tlg
+++ b/base/testfiles-lthooks2/ltpara-002.tlg
@@ -5,13 +5,13 @@ PARA: 1 end (document level on input line ...)
PARA: 1 start (document level on input line ...)
PARA: 1 end (document level on input line ...)
! LaTeX hooks Error: Illegal mode change in hook 'para/begin'.
-(hooks) Hook code did not remain in vertical mode.
+(hooks) Hook code did not remain in horizontal mode.
For immediate help type H <return>.
...
l. ...A
second para.
Paragraph hooks cannot change the TeX mode without causing endless recursion.
-The hook code in 'para/begin' needs to stay in vertical mode, but it didn't.
+The hook code in 'para/begin' needs to stay in horizontal mode, but it didn't.
Examine the hook code with \ShowHook to find the issue.
PARA: 1 start (document level on input line ...)
PARA: 1 end (document level on input line ...)
More information about the latex3-commits
mailing list.