[latex3-commits] [git/LaTeX3-latex3-latex2e] gh606: suggested rewrite (e7267bc4)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Sep 6 17:43:08 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh606
Link       : https://github.com/latex3/latex2e/commit/e7267bc4de0906231b495a3bb8d905efccfa9430

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

commit e7267bc4de0906231b495a3bb8d905efccfa9430
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Sep 6 17:43:08 2021 +0200

    suggested rewrite


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

e7267bc4de0906231b495a3bb8d905efccfa9430
 base/doc/ltnews34.tex        | 43 +++++++++++++------------------------------
 base/update-lthooks-tests.sh | 12 +++++++++++-
 2 files changed, 24 insertions(+), 31 deletions(-)

diff --git a/base/doc/ltnews34.tex b/base/doc/ltnews34.tex
index ae3ce570..66a7374c 100644
--- a/base/doc/ltnews34.tex
+++ b/base/doc/ltnews34.tex
@@ -219,23 +219,19 @@ document are printed. For such situations the new command
 
 \subsection{Clean up after \cs{UseOneTimeHook}}
 
-Some hooks are meant to be used only once in a document, and any further
-attempt to add code to it, causes the code to be executed immediately.
-The code for that was very simple and didn't anticipate any code trying
-to use a one-time hook twice, as in:
-\begin{verbatim}
-\UseOneTimeHook{hook}
-\UseOneTimeHook{hook}
-\end{verbatim}
-which would result in the hook code being executed twice.  This was fine
-for simple usages as in the \hook{begindocument} hook, but caused
-trouble if the one-time hook was used, for example, as an initialization
-hook, which is used once when a command is first called, then ignored in
-further calls.
-
-This issue has been addressed, and now a one-time hook will never be
-executed twice, and additionally it cleans up all the code added to it
-so far to free up some memory.
+Some hooks are meant to be used only once in a document, and any
+further attempt to add code to them, causes the code to be executed
+immediately instead of being added to the hook.  The initial implementation of
+this concept was very simple and didn't anticipate that packages may try to
+execute a one-time hook several times resulting in the hook code
+being executed repeatedly.  Thus, the implementation was fine for
+simple usages (e.g., the \hook{begindocument} hook), but caused
+trouble if the one-time hook was intended, for example, as an
+initialization hook that is used once when a command is first
+called, but then ignored in further calls.
+
+This deficiency has been addressed, and now a one-time hook will only be executed once
+and the hook code is removed after usage to free up the memory.
 %
 \githubissue{565}
 
@@ -299,19 +295,6 @@ deprecated names will be turned into errors and then removed completely.
 
 
 
-
-
-\subsection{???}
-
-%
-\githubissue{000}
-
-
-
-
-
-\section{Hook business}
-
 \subsection{Changed how \cs{RemoveFromHook} treats code that isn't in the hook}
 
 In the first version of \cs{RemoveFromHook}, in case the code label
diff --git a/base/update-lthooks-tests.sh b/base/update-lthooks-tests.sh
index 2b8176f8..72de1895 100644
--- a/base/update-lthooks-tests.sh
+++ b/base/update-lthooks-tests.sh
@@ -80,6 +80,7 @@ l3build save -cconfig-lthooks \
    lthooks-028 \
    lthooks-029 \
    lthooks-029-deprecated \
+   lthooks-030 \
    lthooks-errors \
    lthooks-errors-deprecated \
    lthooks-etoolbox \
@@ -89,7 +90,16 @@ l3build save -cconfig-lthooks \
    shipout-002 \
    shipout-004 \
    shipout-005 \
-   github-0565
+   github-0379 \
+   github-0387 \
+   github-0401 \
+   github-0464 \
+   github-0565 \
+   github-0606 \
+   github-0648 \
+   github-0648b 
+
+
 
 exit
 





More information about the latex3-commits mailing list.