[latex3-commits] [git/LaTeX3-latex3-latex2e] gh962-et-al-dev: use a private register instead of a group (3156b4d7)
Frank Mittelbach
frank.mittelbach at latex-project.org
Tue Nov 29 17:57:26 CET 2022
Repository : https://github.com/latex3/latex2e
On branch : gh962-et-al-dev
Link : https://github.com/latex3/latex2e/commit/3156b4d79658756ebd44790a415150bc5a52ae8d
>---------------------------------------------------------------
commit 3156b4d79658756ebd44790a415150bc5a52ae8d
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date: Tue Nov 29 17:57:26 2022 +0100
use a private register instead of a group
>---------------------------------------------------------------
3156b4d79658756ebd44790a415150bc5a52ae8d
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 b414569d..914adf00 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -56,7 +56,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.