[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh962-et-al: use a private register instead of a group (fda509b1)

Frank Mittelbach frank.mittelbach at latex-project.org
Tue Nov 29 17:59:34 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh962-et-al
Link       : https://github.com/latex3/latex2e/commit/fda509b1c24bc95a9caa00958f8ddb304446e32d

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

commit fda509b1c24bc95a9caa00958f8ddb304446e32d
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Tue Nov 29 17:59:34 2022 +0100

    use a private register instead of a group


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

fda509b1c24bc95a9caa00958f8ddb304446e32d
 base/changes.txt |  3 ++-
 base/ltspace.dtx | 10 ++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 4e69cb0e..c91de6c7 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -17,7 +17,8 @@ All changes above are only part of the development branch for the next release.
 2022-11-28  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* ltspace.dtx (subsection{Horizontal space (and breaks)}):
-	We start with \hspace with \leavevmode in case it starts the paragraph.
+	We use a private register instead of a group with \hspace in case it
+	starts the paragraph.
 	Otherwise \everypar and friends will be executed inside a group (gh/967)
 
 2022-11-28  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
diff --git a/base/ltspace.dtx b/base/ltspace.dtx
index f9a956b8..6147bea6 100644
--- a/base/ltspace.dtx
+++ b/base/ltspace.dtx
@@ -1268,12 +1268,14 @@
 %<latexrelease>\IncludeInRelease{2020/10/01}%
 %<latexrelease>                 {\@hspace}{Support calc with \hspace}%
 %    \end{macrocode}
-%    We start with \cs{leavevmode} in case the \cs{hspace} starts the paragraph.
-%    Otherwise \cs{everypar} etc.\ will end up inside the group. This is a bug fix so
+%    We use a private register to calculate the space (if \pkg{calc} is used). Previously
+%    we used a group but that results in
+%    \cs{everypar} etc.\ being executed inside the group if the \cs{hspace} starts a paragraph.
+%    This is a bug fix so
 %    we do not provide rollback to the incorrect intermediate version.
 %    \begin{macrocode}
-\def\@hspace#1{\leavevmode
-   \begingroup\setlength\skip@{#1}\hskip\skip@\endgroup}
+\newskip\hsp at ce@skip
+\def\@hspace#1{\setlength\hsp at ce@skip{#1}\hskip\hsp at ce@skip}
 %</2ekernel|latexrelease>
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}





More information about the latex3-commits mailing list.