[latex3-commits] [git/LaTeX3-latex3-latex2e] copyedits-chris: Merge branch 'develop' into copyedits-chris (58adf04d)

Frank Mittelbach frank.mittelbach at latex-project.org
Thu Oct 21 14:06:49 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : copyedits-chris
Link       : https://github.com/latex3/latex2e/commit/58adf04de0b09e81d574a927c8de78a830c0a84c

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

commit 58adf04de0b09e81d574a927c8de78a830c0a84c
Merge: c2428bcc 19c6ec84
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Thu Oct 21 14:06:49 2021 +0200

    Merge branch 'develop' into copyedits-chris


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

58adf04de0b09e81d574a927c8de78a830c0a84c
 base/changes.txt                                   |  11 +
 base/doc/ltnews34.tex                              |  17 +
 base/ltcmdhooks.dtx                                | 360 ++++++++++++++++++---
 base/ltpara.dtx                                    |  14 +-
 base/source2edoc.cls                               |  18 ++
 base/testfiles-legacy/github-0255-2019.tlg         |   1 -
 base/testfiles-lthooks/github-0697.lvt             |  41 +++
 .../{github-0675.tlg => github-0697.tlg}           |  13 +-
 base/testfiles/github-0327-rollback.luatex.tlg     |   3 -
 base/testfiles/github-0327-rollback.tlg            |   3 -
 base/testfiles/github-0327-rollback.xetex.tlg      |   3 -
 base/testfiles/tlb-utf8-dec-cp1252-2017.luatex.tlg |   1 -
 base/testfiles/tlb-utf8-dec-cp1252-2017.tlg        |   1 -
 base/testfiles/tlb-utf8-dec-cp1252-2017.xetex.tlg  |   1 -
 base/testfiles/tlb-utf8-dec-utf8-2017.luatex.tlg   |   1 -
 base/testfiles/tlb-utf8-dec-utf8-2017.tlg          |   1 -
 base/testfiles/tlb-utf8-dec-utf8-2017.xetex.tlg    |   1 -
 .../tlb-utf8-undec-cp1252-2017.luatex.tlg          |   1 -
 base/testfiles/tlb-utf8-undec-cp1252-2017.tlg      |   1 -
 .../testfiles/tlb-utf8-undec-cp1252-2017.xetex.tlg |   1 -
 base/testfiles/tlb-utf8-undec-utf8-2017.luatex.tlg |   1 -
 base/testfiles/tlb-utf8-undec-utf8-2017.tlg        |   1 -
 base/testfiles/tlb-utf8-undec-utf8-2017.xetex.tlg  |   1 -
 base/testfiles/tlb0057.luatex.tlg                  |   3 -
 base/testfiles/tlb0057.tlg                         |   3 -
 base/testfiles/tlb0084.tlg                         |   5 -
 base/testfiles/tlb0480.luatex.tlg                  |   2 -
 base/testfiles/tlb0480.tlg                         |   2 -
 base/testfiles/tlb2583.tlg                         |   2 -
 base/testfiles/tlb3855-20170101.luatex.tlg         |   2 -
 base/testfiles/tlb3855-20170101.tlg                |   2 -
 base/testfiles/vlatex03.luatex.tlg                 |  48 ---
 base/testfiles/vlatex03.tlg                        |  48 ---
 base/testfiles/vlatex06.luatex.tlg                 |  59 ----
 base/testfiles/vlatex06.tlg                        |  59 ----
 base/testfiles/vtl2e03.luatex.tlg                  |  49 ---
 base/testfiles/vtl2e03.tlg                         |  49 ---
 .../tools/testfiles-search/tlb-varioref-005.tlg    |  20 --
 required/tools/testfiles/tlb2149.tlg               |   1 -
 texmf/tex/latex/l3backend/l3backend-dvipdfmx.def   |  54 +++-
 texmf/tex/latex/l3backend/l3backend-dvips.def      |   4 +-
 texmf/tex/latex/l3backend/l3backend-dvisvgm.def    |  20 +-
 texmf/tex/latex/l3backend/l3backend-luatex.def     |  54 +++-
 texmf/tex/latex/l3backend/l3backend-pdftex.def     |  54 +++-
 texmf/tex/latex/l3backend/l3backend-xetex.def      |  54 +++-
 texmf/tex/latex/l3kernel/expl3-code.tex            | 112 ++++++-
 texmf/tex/latex/l3kernel/expl3-generic.tex         |   2 +-
 texmf/tex/latex/l3kernel/expl3.ltx                 |   2 +-
 texmf/tex/latex/l3kernel/expl3.sty                 |   2 +-
 49 files changed, 765 insertions(+), 443 deletions(-)

diff --cc base/doc/ltnews34.tex
index d6c5f28a,23d5f304..aecb1658
--- a/base/doc/ltnews34.tex
+++ b/base/doc/ltnews34.tex
@@@ -262,54 -294,51 +262,67 @@@ then removed completely
  \githubissue{648}
  
  
 +\subsection{Some file hooks made one-time}
  
 -\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.
 +Classes, packages and included files can only be loaded once in a
 +\LaTeX{} document. For this reason, the hooks that are specific to loading such
 +files have been made one-time hooks. Beside being more efficient, this
 +supports the following important use case
 +\begin{verbatim}
 +  \AddToHook{package/varioref/after}
 +   {... apply when the package gets loaded, 
 +    or apply now (if it is already loaded) ...}
 +\end{verbatim}
 +without the need to first test whether the package is already loaded.
  %
 -\githubissue{625}
 +\githubissue{623}
  
  
 +\subsection{Clearing extra hook code for the next invocation}
 +
 +There are a few use cases where it is 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 now provided.
 +%
 +\githubissue{565}
  
+ \subsection{Fix patching of commands that contain parameter tokens}
+ 
+ In the previous release, \LaTeX's hook mechanism was extended to add
+ support for hooking into commands using generic \hook{cmd} hooks
+ (see~\cite{34:ltnews33}).  The initial version had a bug, in which the
+ patching of some commands with a parameter token (normally \verb|#|) in
+ their definition would fail with a low-level \TeX{} error.  The bug has
+ been fixed, and now patching works for those commands as well.
+ %
+ \githubissue{697}
+ 
+ 
+ 
  
 -\subsection{???}
 +\subsection{Cleaning up after \cs{UseOneTimeHook}}
  
 +Some hooks are meant to be used only once in a document, and any
 +further attempt to add code to one of these will 
 +cause the code to be executed
 +immediately instead of being added to the hook.  
  %
 -\githubissue{000}
 +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 cases (such as the \hook{begindocument} hook) but it causes
 +trouble if the one-time hook was intended, for example, as an
 +initialization hook that is used just once (when a command is first
 +called) but is then ignored in further calls.
  
 +This deficiency has been addressed, and now a one-time 
 +hook will only be executed once, with
 +its code being removed after use to free up some memory.
 +%
 +\githubissue{565}
  
  
  





More information about the latex3-commits mailing list.