[latex3-commits] [git/LaTeX3-latex3-latex2e] gh625: Add changes.txt and ltnews34 entries (d38540ab)

PhelypeOleinik phelype.oleinik at latex-project.org
Wed Jul 28 01:24:18 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh625
Link       : https://github.com/latex3/latex2e/commit/d38540ab9ee1ce9ee41ba721ae0bf65940a4c3ba

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

commit d38540ab9ee1ce9ee41ba721ae0bf65940a4c3ba
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Tue Jul 27 20:24:18 2021 -0300

    Add changes.txt and ltnews34 entries


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

d38540ab9ee1ce9ee41ba721ae0bf65940a4c3ba
 base/changes.txt      |  6 ++++++
 base/doc/ltnews34.tex | 24 ++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/base/changes.txt b/base/changes.txt
index f666bec5..5cfdc54d 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,12 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2021-07-20  Phelype Oleinik  <phelype.oleinik at latex-project.org>
+
+	* lthooks.dtx:
+	Simplify \RemoveFromHook to not queue the removal of code chunks
+	that aren't yet in the hook (gh/625).
+
 2021-07-20  Phelype Oleinik  <phelype.oleinik at latex-project.org>
 
 	* ltcmdhooks.dtx:
diff --git a/base/doc/ltnews34.tex b/base/doc/ltnews34.tex
index 5041f583..e16828f8 100644
--- a/base/doc/ltnews34.tex
+++ b/base/doc/ltnews34.tex
@@ -142,6 +142,30 @@
 
 \emph{write}
 
+\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
+being removed didn't exist in the hook, a ``removal order'' would be
+queued, and the next time something tried to add that label to the hook,
+the \cs{AddToHook} would be cancelled by the removal order, and no code
+would be added that once.  This was so that in principle package loading
+order wouldn't matter.  However this implementation didn't work quite as
+intended, because while two \cs{AddToHook} to a given label would be
+removed by a single \cs{RemoveFromHook}, one \cs{RemoveFromHook} could
+not cancel two \cs{AddToHook} to that label, and this asymmetry caused
+confusion and was a recipe for further problems.
+
+The implementation was changed and now \cs{RemoveFromHook} only removes
+labels that already exist in a hook, and will raise error if they don't.
+For usage across packages, for removing code in a hook, the
+\texttt{voids} relation should be used instead:  this relation is
+non-destructive (meaning it can be later reverted with another one), and
+it is truly independent of package loading order, so it should be
+preferred.
+%
+\githubissue{625}
 
 \section{New or improved commands}
 





More information about the latex3-commits mailing list.