[latex3-commits] [git/LaTeX3-latex3-latex2e] gh625: Merge branch 'develop' into gh625 (56d82b49)
GitHub
noreply at github.com
Wed Jul 28 14:29:40 CEST 2021
Repository : https://github.com/latex3/latex2e
On branch : gh625
Link : https://github.com/latex3/latex2e/commit/56d82b49aa7573d4b751f45d7938b684fd37a9c0
>---------------------------------------------------------------
commit 56d82b49aa7573d4b751f45d7938b684fd37a9c0
Merge: 5da20f6a 11aaca07
Author: Phelype Oleinik <phelype.oleinik at latex-project.org>
Date: Wed Jul 28 09:29:40 2021 -0300
Merge branch 'develop' into gh625
>---------------------------------------------------------------
56d82b49aa7573d4b751f45d7938b684fd37a9c0
.github/workflows/main.yaml | 189 +++++++++++++++++++++
base/changes.txt | 15 ++
base/doc/ltnews34.tex | 48 +++++-
base/ltclass.dtx | 14 +-
base/ltfilehook.dtx | 24 ++-
base/ltfiles.dtx | 11 +-
base/lthooks.dtx | 115 ++++++++++---
base/testfiles-lthooks/github-0565.lvt | 15 ++
.../github-0565.tlg} | 4 +
base/testfiles-lthooks/lthooks-errors.tlg | 2 +-
base/testfiles/github-0626.lvt | 51 ++++++
base/testfiles/github-0626.tlg | 25 +++
base/update-lthooks-tests.sh | 27 +--
13 files changed, 493 insertions(+), 47 deletions(-)
diff --cc base/changes.txt
index 5cfdc54d,db41e0ac..f7b5d57a
--- a/base/changes.txt
+++ b/base/changes.txt
@@@ -6,12 -6,21 +6,27 @@@ completeness or accuracy and it contain
are not part of the distribution.
================================================================================
+ 2021-07-27 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+
+ * lthooks.dtx:
+ Some clarification on hook command behavior.
+ Commands \ClearHookNext and \hook_gclear_next_code:n added (gh/565)
+
+ 2021-07-23 Frank Mittelbach <Frank.Mittelbach at latex-project.org>
+
+ * ltclass.dtx (section{Implementation}):
+ Make class/.../name one-time hooks;
+ Make package/.../name one-time hooks (gh/626)
+
+ * ltfiles.dtx (section{File Handling}):
+ Make include/.../name one-time hooks (gh/626)
+
+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 --cc base/doc/ltnews34.tex
index a6f7fce5,e2b190a4..cba35415
--- a/base/doc/ltnews34.tex
+++ b/base/doc/ltnews34.tex
@@@ -138,34 -138,54 +138,78 @@@
\emph{write}
- \section{???}
- \emph{write}
+
+
+ \section{Hook business}
+
+
+
+ \subsection{Clear extra hook code for next invocation}
+
+ There are a few use cases where it would be helpful if one can cancel
+ an earlier use of \cs{AddToHookNext}, for example, when a page is
+ discarded with \cs{DiscardShipoutBox} because only some pages of the
+ document are printed. For such situations the new command
+ \cs{ClearHookNext} is provided.
+ %
+ \githubissue{565}
+
+
+
+ \subsection{Class, package, and include hook improvements}
+
+ Classes, packages and include files can only be loaded once in a
+ \LaTeX{} document. For that reasons hooks that are specific to such
+ files have been made one-time hooks. Beside being more efficient this
+ supports the following important use case
+ \begin{verbatim}
+ \AddToHook{package/after/varioref}
+ { ... apply my customizations if the package
+ gets loaded (or was loaded already) ... }
+ \end{verbatim}
+ without the need to first test if the package was already loaded
+ before.
+ %
+ \githubissue{623}
+
+
+
+
+
+ \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
+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 display a warning 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.