From b0c666dbd315af330424f5d34739d7d4134d0c17 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 2 Jun 2024 20:26:39 +0000
Subject: latex2e (2jun24)

git-svn-id: svn://tug.org/texlive/trunk@71408 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/source/latex/base/lthooks.dtx | 405 +++++++++++++++---------
 1 file changed, 260 insertions(+), 145 deletions(-)

(limited to 'Master/texmf-dist/source/latex/base/lthooks.dtx')

diff --git a/Master/texmf-dist/source/latex/base/lthooks.dtx b/Master/texmf-dist/source/latex/base/lthooks.dtx
index 446cdaae060..d282ff841c7 100644
--- a/Master/texmf-dist/source/latex/base/lthooks.dtx
+++ b/Master/texmf-dist/source/latex/base/lthooks.dtx
@@ -27,17 +27,16 @@
 % \fi
 %
 % \iffalse
-%
 %%% From File: lthooks.dtx
 %
-%    \begin{macrocode}
-\def\lthooksversion{v1.1f}
-\def\lthooksdate{2023/10/02}
-%    \end{macrocode}
-%
 %<*driver>
+% \fi
+\ProvidesFile{lthooks.dtx}
+             [2024/04/22 v1.1h LaTeX Kernel (hooks)]
+% \iffalse
+%
 \documentclass{l3doc}
-
+\GetFileInfo{lthooks.dtx}
 
 \providecommand\InternalDetectionOff{}
 \providecommand\InternalDetectionOn{}
@@ -62,7 +61,7 @@
 %
 %
 % \title{\LaTeX{}'s hook management\thanks{This module has version
-%    \lthooksversion\ dated \lthooksdate, \copyright\ \LaTeX\
+%    \fileversion\ dated \filedate, \copyright\ \LaTeX\
 %    Project.}}
 %
 % \author{Frank Mittelbach\thanks{Code improvements for speed and other goodies by Phelype Oleinik}}
@@ -160,7 +159,7 @@
 % \end{function}
 %
 %
-% \begin{function}{\NewHookWithArguments}
+% \begin{function}[added=2023-06-01]{\NewHookWithArguments}
 %   \begin{syntax}
 %     \cs{NewHookWithArguments} \Arg{hook} \Arg{number}
 %   \end{syntax}
@@ -172,7 +171,7 @@
 %    the current package name. See section~\ref{sec:default-label}.
 % \end{function}
 %
-% \begin{function}{\NewReversedHookWithArguments}
+% \begin{function}[added=2023-06-01]{\NewReversedHookWithArguments}
 %   \begin{syntax}
 %     \cs{NewReversedHookWithArguments} \Arg{hook} \Arg{number}
 %   \end{syntax}
@@ -184,7 +183,7 @@
 %    the current package name. See section~\ref{sec:default-label}.
 % \end{function}
 %
-% \begin{function}{\NewMirroredHookPairWithArguments}
+% \begin{function}[added=2023-06-01]{\NewMirroredHookPairWithArguments}
 %   \begin{syntax}
 %     \cs{NewMirroredHookPairWithArguments} \Arg{hook-1} \Arg{hook-2} \Arg{number}
 %   \end{syntax}
@@ -234,9 +233,9 @@
 %    (e.g., one used in code with \cs{UseHook} or
 %    \cs{UseOneTimeHook}) without it being explicitly declared with
 %    \cs{NewHook}).
-%    This command undoes the effect of \cs{DisableGenericHook}.
 %    If the hook is already activated, this command does nothing.
 %
+%    Note that this command does not undo the effect of \cs{DisableGenericHook}.
 %    See section~\ref{sec:generic-hooks} for a discussion of when this
 %    declaration is appropriate.
 % \end{function}
@@ -264,7 +263,7 @@
 %    A leading |.| is treated literally.
 % \end{function}
 %
-% \begin{function}{\UseHookWithArguments}
+% \begin{function}[added=2023-06-01]{\UseHookWithArguments}
 %   \begin{syntax}
 %     \cs{UseHookWithArguments} \Arg{hook} \Arg{number} \Arg{arg_1} \ldots \Arg{arg_n}
 %   \end{syntax}
@@ -314,7 +313,7 @@
 %
 % \end{function}
 %
-% \begin{function}{\UseOneTimeHookWithArguments}
+% \begin{function}[added=2023-06-01]{\UseOneTimeHookWithArguments}
 %   \begin{syntax}
 %     \cs{UseOneTimeHookWithArguments} \Arg{hook} \Arg{number} \Arg{arg_1} \ldots \Arg{arg_n}
 %   \end{syntax}
@@ -340,7 +339,7 @@
 %
 % \begin{function}{\AddToHook}
 %   \begin{syntax}
-%     \cs{AddToHook} \Arg{hook}\oarg{label}\Arg{code}
+%     \cs{AddToHook} \Arg{hook} \oarg{label} \Arg{code}
 %   \end{syntax}
 %    Adds \meta{code} to the \meta{hook} labeled by \meta{label}.
 %    When the optional argument \meta{label} is not provided, the
@@ -368,9 +367,9 @@
 %    See section~\ref{sec:default-label}.
 % \end{function}
 %
-% \begin{function}{\AddToHookWithArguments}
+% \begin{function}[added=2023-06-01]{\AddToHookWithArguments}
 %   \begin{syntax}
-%     \cs{AddToHookWithArguments} \Arg{hook}\oarg{label}\Arg{code}
+%     \cs{AddToHookWithArguments} \Arg{hook} \oarg{label} \Arg{code}
 %   \end{syntax}
 %    Works exactly like \cs{AddToHook}, except that the \meta{code} can
 %    access the arguments passed to the hook using \verb|#1|, \verb|#2|,
@@ -398,7 +397,7 @@
 %
 % \begin{function}{\RemoveFromHook}
 %   \begin{syntax}
-%     \cs{RemoveFromHook} \Arg{hook}\oarg{label}
+%     \cs{RemoveFromHook} \Arg{hook} \oarg{label}
 %   \end{syntax}
 %    Removes any code labeled by \meta{label} from the \meta{hook}.
 %    When the optional argument \meta{label} is not provided, the
@@ -459,7 +458,7 @@
 %
 % \begin{function}{\AddToHookNext}
 %   \begin{syntax}
-%     \cs{AddToHookNext} \Arg{hook}\Arg{code}
+%     \cs{AddToHookNext} \Arg{hook} \Arg{code}
 %   \end{syntax}
 %    Adds \meta{code} to the next invocation of the \meta{hook}.
 %    The code is executed after the normal hook code has finished and
@@ -505,9 +504,9 @@
 % \end{function}\footnotetext{There is
 %    no mechanism to reorder such code chunks (or delete them).}
 %
-% \begin{function}{\AddToHookNextWithArguments}
+% \begin{function}[added=2023-06-01]{\AddToHookNextWithArguments}
 %   \begin{syntax}
-%     \cs{AddToHookNextWithArguments} \Arg{hook}\Arg{code}
+%     \cs{AddToHookNextWithArguments} \Arg{hook} \Arg{code}
 %   \end{syntax}
 %    Works exactly like \cs{AddToHookNext}, but the \meta{code} can
 %    contain references to the arguments of the \meta{hook} as described
@@ -522,7 +521,7 @@
 %
 % \begin{function}{\ClearHookNext}
 %   \begin{syntax}
-%     \cs{ClearHookNext}\Arg{hook}
+%     \cs{ClearHookNext} \Arg{hook}
 %   \end{syntax}
 %    Normally \cs{AddToHookNext} is only used when you know precisely
 %    where it will apply and why you want some extra code at that
@@ -746,7 +745,7 @@
 %
 % \begin{function}{\DeclareHookRule}
 %   \begin{syntax}
-%     \cs{DeclareHookRule} \Arg{hook}\Arg{label1}\Arg{relation}\Arg{label2}
+%     \cs{DeclareHookRule} \Arg{hook} \Arg{label1} \Arg{relation} \Arg{label2}
 %   \end{syntax}
 %    Defines a relation between \meta{label1} and \meta{label2} for a
 %    given \meta{hook}. If \meta{hook} is \texttt{??} this defines a default
@@ -807,7 +806,7 @@
 %
 % \begin{function}{\ClearHookRule}
 %   \begin{syntax}
-%     \cs{ClearHookRule}\Arg{hook}\Arg{label1}\Arg{label2}
+%     \cs{ClearHookRule} \Arg{hook} \Arg{label1} \Arg{label2}
 %   \end{syntax}
 %    Syntactic sugar for saying that \meta{label1} and \meta{label2}
 %    are unrelated for the given \meta{hook}.
@@ -817,7 +816,7 @@
 %
 % \begin{function}{\DeclareDefaultHookRule}
 %   \begin{syntax}
-%     \cs{DeclareDefaultHookRule}\Arg{label1}\Arg{relation}\Arg{label2}
+%     \cs{DeclareDefaultHookRule} \Arg{label1} \Arg{relation} \Arg{label2}
 %   \end{syntax}
 %   This sets up a relation between \meta{label1} and \meta{label2}
 %    for all hooks unless overwritten by a specific rule for a hook.
@@ -1004,7 +1003,7 @@
 %
 % \begin{function}{\DebugHooksOn,\DebugHooksOff}
 %   \begin{syntax}
-%     \cs{DebugHooksOn}
+%     \cs{DebugHooksOn} \ldots\ \cs{DebugHooksOff}
 %   \end{syntax}
 %    Turn the debugging of hook code on or off. This displays most changes
 %    made to the hook data structures. The output is rather coarse and
@@ -1044,7 +1043,7 @@
 %    the current package name. See section~\ref{sec:default-label}.
 % \end{function}
 %
-% \begin{function}{
+% \begin{function}[added=2023-06-01]{
 %     \hook_new_with_args:nn,
 %     \hook_new_reversed_with_args:nn,
 %     \hook_new_pair_with_args:nnn
@@ -1100,9 +1099,14 @@
 %
 %
 %
-% \begin{function}{\hook_use:n,\hook_use:nnw}
+% \begin{function}{\hook_use:n}
+%   \begin{syntax}
+%     ~~\cs{hook_use:n} \Arg{hook}
+%   \end{syntax}
+% \end{function}
+% \vskip-1.2\baselineskip
+% \begin{function}[added=2023-06-01]{\hook_use:nnw}
 %   \begin{syntax}
-%     \cs{hook_use:n} \Arg{hook}
 %     \cs{hook_use:nnw} \Arg{hook} \Arg{number} \Arg{arg_1} \ldots \Arg{arg_n}
 %   \end{syntax}
 %    Executes the \Arg{hook} code followed (if set up) by the code for next
@@ -1118,9 +1122,14 @@
 %    A leading |.| is treated literally.
 % \end{function}
 %
-% \begin{function}{\hook_use_once:n,\hook_use_once:nnw}
+% \begin{function}{\hook_use_once:n}
 %   \begin{syntax}
 %     \cs{hook_use_once:n} \Arg{hook}
+%   \end{syntax}
+% \end{function}
+% \vskip-1.2\baselineskip
+% \begin{function}[added=2023-06-01]{\hook_use_once:nnw}
+%   \begin{syntax}
 %     \cs{hook_use_once:nnw} \Arg{hook} \Arg{number} \Arg{arg_1} \ldots \Arg{arg_n}
 %   \end{syntax}
 %     Changes the \Arg{hook} status so that from now on any addition to
@@ -1139,10 +1148,16 @@
 %
 % \begin{function}{
 %     \hook_gput_code:nnn,
+%   }
+%   \begin{syntax}
+%     ~~~~~~~~~\cs{hook_gput_code:nnn} \Arg{hook} \Arg{label} \Arg{code}
+%   \end{syntax}
+% \end{function}
+% \vskip -1.2\baselineskip
+% \begin{function}[added=2023-06-01]{
 %     \hook_gput_code_with_args:nnn
 %   }
 %   \begin{syntax}
-%     \cs{hook_gput_code:nnn} \Arg{hook} \Arg{label} \Arg{code}
 %     \cs{hook_gput_code_with_args:nnn} \Arg{hook} \Arg{label} \Arg{code}
 %   \end{syntax}
 %    Adds a chunk of \meta{code} to the \meta{hook} labeled
@@ -1168,10 +1183,17 @@
 %
 % \begin{function}{
 %     \hook_gput_next_code:nn,
+%   }
+%   \begin{syntax}
+%     ~~~~~~~~~~~~~\cs{hook_gput_next_code:nn} \Arg{hook} \Arg{code}
+%   \end{syntax}
+% \end{function}
+% \vskip-1.2\baselineskip
+% \begin{function}[added=2023-06-01]{
 %     \hook_gput_next_code_with_args:nn,
 %   }
 %   \begin{syntax}
-%     \cs{hook_gput_next_code:nn} \Arg{hook} \Arg{code}
+%     \cs{hook_gput_next_code_with_args:nn} \Arg{hook} \Arg{code}
 %   \end{syntax}
 %    Adds a chunk of \meta{code} for use only in the next invocation of the
 %    \meta{hook}. Once used it is gone.
@@ -1183,6 +1205,7 @@
 %    In that case, if an actual parameter token should be added to the
 %    code, it should be doubled.
 %
+% \end{function}
 %    This is simpler than \cs{hook_gput_code:nnn}, the code is simply
 %    appended to the hook in the order of declaration at the very end,
 %    i.e., after all standard code for the hook got executed.
@@ -1191,7 +1214,6 @@
 %
 %    The \meta{hook} can be specified using the dot-syntax to denote
 %    the current package name. See section~\ref{sec:default-label}.
-% \end{function}
 %
 %
 % \begin{function}{\hook_gclear_next_code:n}
@@ -1527,7 +1549,7 @@
 %    \hook{cmd},
 %    \hook{env},
 %    \hook{file},
-%    \hook{include}
+%    \hook{include},
 %    \hook{package}, and
 %    \hook{class},
 %    and all these are available out of the box: you only have to 
@@ -1862,15 +1884,17 @@
 %    \item[\hook{env/\meta{env}/begin}]
 %
 %       This hook is executed as part of \cs{begin} directly in front
-%       of the code specific to the environment start (e.g., the
-%       second argument of \cs{newenvironment}).  Its scope is the
-%       environment body.
+%       of the code specific to the environment start (e.g.,
+%       the third argument of \cs{NewDocumentEnvironment} and
+%       the second argument of \cs{newenvironment}).
+%       Its scope is the environment body.
 %
 %    \item[\hook{env/\meta{env}/end}]
 %
 %       This hook is executed as part of \cs{end} directly in front of the
-%       code specific to the end of the environment (e.g., the third
-%       argument of \cs{newenvironment}).
+%       code specific to the end of the environment (e.g.,
+%       the forth argument of \cs{NewDocumentEnvironment} and
+%       the third argument of \cs{newenvironment}).
 %
 %    \item[\hook{env/\meta{env}/after}]
 %
@@ -2701,7 +2725,7 @@
 %    \hook_new:n,
 %    \hook_new_with_args:nn
 %  }
-%  \begin{macro}{@@_new:nn}
+%  \begin{macro}{\@@_new:nn}
 %    The \cs{hook_new:n} declaration declares a new hook and expects
 %    the hook \meta{name} as its argument, e.g.,
 %    \hook{begindocument}.
@@ -3509,7 +3533,8 @@
         \msg_error:nnnnn { hooks } { set-top-level }
           { for } { SetDefaultHookLabel } {#1}
       }
-      { \exp_args:Nx \@@_set_default_label:n { \@@_make_name:n {#1} } }
+      { \exp_args:Nx
+        \@@_set_default_label:n { \@@_make_name:n {#1} } }
   }
 \cs_new_protected:Npn \@@_set_default_label:n #1
   {
@@ -3722,7 +3747,8 @@
 %<latexrelease>\IncludeInRelease{2020/10/01}{\hook_gput_code:nnn}
 %<latexrelease>                 {Providing~hooks}
 %<latexrelease>\cs_gset_protected:Npn \hook_gput_code:nnn #1 #2
-%<latexrelease>  { \@@_normalize_hook_args:Nnn \@@_gput_code:nnn {#1} {#2} }
+%<latexrelease>  { \@@_normalize_hook_args:Nnn
+%<latexrelease>        \@@_gput_code:nnn {#1} {#2} }
 %<latexrelease>\cs_gset_protected:Npn \@@_gput_code:nnn #1 #2 #3
 %<latexrelease>  {
 %<latexrelease>    \@@_if_execute_immediately:nTF {#1}
@@ -3736,7 +3762,8 @@
 %<latexrelease>          {
 %<latexrelease>            \@@_if_disabled:nTF {#1}
 %<latexrelease>              { \msg_error:nnn { hooks } { hook-disabled } {#1} }
-%<latexrelease>              { \@@_try_declaring_generic_hook:nnn {#1} {#2} {#3} }
+%<latexrelease>              { \@@_try_declaring_generic_hook:nnn
+%<latexrelease>                  {#1} {#2} {#3} }
 %<latexrelease>          }
 %<latexrelease>      }
 %<latexrelease>  }
@@ -3748,7 +3775,8 @@
 %<latexrelease>                      \on@line\space <-~ \tl_to_str:n{#3}} }
 %<latexrelease>    \str_if_eq:nnTF {#2} { top-level }
 %<latexrelease>      {
-%<latexrelease>        \str_if_eq:eeTF { top-level } { \@@_currname_or_default: }
+%<latexrelease>        \str_if_eq:eeTF { top-level }
+%<latexrelease>                        { \@@_currname_or_default: }
 %<latexrelease>          {
 %<latexrelease>            \@@_init_structure:n {#1}
 %<latexrelease>            \@@_tl_gput_right:cn { @@_toplevel~#1 } {#3}
@@ -3756,7 +3784,8 @@
 %<latexrelease>          { \msg_error:nnn { hooks } { misused-top-level } {#1} }
 %<latexrelease>      }
 %<latexrelease>      {
-%<latexrelease>        \prop_get:cnNTF { g_@@_#1_code_prop } {#2} \l_@@_return_tl
+%<latexrelease>        \prop_get:cnNTF
+%<latexrelease>          { g_@@_#1_code_prop } {#2} \l_@@_return_tl
 %<latexrelease>          {
 %<latexrelease>            \prop_gput:cno { g_@@_#1_code_prop } {#2}
 %<latexrelease>              { \l_@@_return_tl #3 }
@@ -3840,7 +3869,8 @@
 % \changes{v1.1d}{2023/05/21}
 %         {Changes to allow support arguments in cmd hooks (cmd-args).}
 %    \begin{macrocode}
-%<latexrelease>\IncludeInRelease{2023/06/01}{\@@_try_declaring_generic_hook:nnn}
+%<latexrelease>\IncludeInRelease{2023/06/01}
+%<latexrelease>                 {\@@_try_declaring_generic_hook:nnn}
 %<latexrelease>                 {Hooks~with~args}
 \cs_new_protected:Npn \@@_try_declaring_generic_hook:nnn #1
   {
@@ -3857,31 +3887,38 @@
         {#1}
   }
 %<latexrelease>\EndIncludeInRelease
-%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_try_declaring_generic_hook:nnn}
+%<latexrelease>\IncludeInRelease{2021/11/15}
+%<latexrelease>                 {\@@_try_declaring_generic_hook:nnn}
 %<latexrelease>                 {Standardise~generic~hook~names}
 %<latexrelease>\cs_gset_protected:Npn \@@_try_declaring_generic_hook:nnn #1
 %<latexrelease>  {
-%<latexrelease>    \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1}
+%<latexrelease>    \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop:
+%<latexrelease>      {#1}
 %<latexrelease>      \hook_gput_code:nnn
 %<latexrelease>      \@@_gput_undeclared_hook:nnn
 %<latexrelease>        {#1}
 %<latexrelease>  }
-%<latexrelease>\cs_gset_protected:Npn \@@_try_declaring_generic_next_hook:nn #1
+%<latexrelease>\cs_gset_protected:Npn
+%<latexrelease>  \@@_try_declaring_generic_next_hook:nn #1
 %<latexrelease>  {
-%<latexrelease>    \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1}
+%<latexrelease>    \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop:
+%<latexrelease>      {#1}
 %<latexrelease>      \hook_gput_next_code:nn
 %<latexrelease>      \@@_gput_next_do:nn
 %<latexrelease>        {#1}
 %<latexrelease>  }
 %<latexrelease>\EndIncludeInRelease
-%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_try_declaring_generic_hook:nnn}
+%<latexrelease>\IncludeInRelease{2020/10/01}
+%<latexrelease>                 {\@@_try_declaring_generic_hook:nnn}
 %<latexrelease>                 {Standardise~generic~hook~names}
-%<latexrelease>\cs_new_protected:Npn \@@_try_declaring_generic_hook:nnn #1
+%<latexrelease>\cs_new_protected:Npn
+%<latexrelease>  \@@_try_declaring_generic_hook:nnn #1
 %<latexrelease>  {
 %<latexrelease>    \@@_try_declaring_generic_hook:nNNnn {#1}
 %<latexrelease>      \hook_gput_code:nnn \@@_gput_undeclared_hook:nnn
 %<latexrelease>  }
-%<latexrelease>\cs_new_protected:Npn \@@_try_declaring_generic_next_hook:nn #1
+%<latexrelease>\cs_new_protected:Npn
+%<latexrelease>  \@@_try_declaring_generic_next_hook:nn #1
 %<latexrelease>  {
 %<latexrelease>    \@@_try_declaring_generic_hook:nNNnn {#1}
 %<latexrelease>      \hook_gput_next_code:nn \@@_gput_next_do:nn
@@ -3904,12 +3941,15 @@
 %
 % \changes{v1.0s}{2021/09/28}
 %                {Correct usage of older \cs{@@_if_file_hook:wTF} (gh/675)}
+% \changes{v1.1h}{2024/01/24}
+%                {Correct usage of older \cs{@@_if_file_hook:wTF} (gh/1243)}
 %    \begin{macrocode}
 %<latexrelease>\cs_new_protected:Npn \@@_try_declaring_generic_hook:nNNnn #1
 %<latexrelease>  {
-%<latexrelease>    \@@_if_file_hook:wTF #1 / \s_@@_mark
+%<latexrelease>    \@@_if_file_hook:wTF #1 / / \s_@@_mark
 %<latexrelease>      {
-%<latexrelease>        \exp_args:Ne \@@_try_declaring_generic_hook_split:nNNnn
+%<latexrelease>        \exp_args:Ne
+%<latexrelease>        \@@_try_declaring_generic_hook_split:nNNnn
 %<latexrelease>          { \exp_args:Ne \@@_file_hook_normalize:n {#1} }
 %<latexrelease>      }
 %<latexrelease>      { \@@_try_declaring_generic_hook_split:nNNnn {#1} }
@@ -3917,9 +3957,11 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-%<latexrelease>\cs_new_protected:Npn \@@_try_declaring_generic_hook_split:nNNnn #1 #2 #3
+%<latexrelease>\cs_new_protected:Npn
+%<latexrelease>    \@@_try_declaring_generic_hook_split:nNNnn #1 #2 #3
 %<latexrelease>  {
-%<latexrelease>    \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop: {#1}
+%<latexrelease>    \@@_try_declaring_generic_hook:wnTF #1 / / / \scan_stop:
+%<latexrelease>      {#1}
 %<latexrelease>      { #2 }
 %<latexrelease>      { #3 } {#1}
 %<latexrelease>  }
@@ -3931,9 +3973,11 @@
 % \changes{v1.1a}{2023/04/06}
 %         {Changes to add hook arguments (hook-args).}
 %    \begin{macrocode}
-%<latexrelease>\IncludeInRelease{2023/06/01}{\@@_try_declaring_generic_hook:wn}
+%<latexrelease>\IncludeInRelease{2023/06/01}
+%<latexrelease>                 {\@@_try_declaring_generic_hook:wn}
 %<latexrelease>                 {Hooks~with~args}
-\prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn
+\prg_new_protected_conditional:Npnn
+    \@@_try_declaring_generic_hook:wn
     #1 / #2 / #3 / #4 \scan_stop: #5 { TF }
   {
     \@@_if_generic:nTF {#5}
@@ -4052,9 +4096,11 @@
 % \end{macro}
 %
 %    \begin{macrocode}
-%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_try_declaring_generic_hook:wn}
+%<latexrelease>\IncludeInRelease{2021/11/15}
+%<latexrelease>                 {\@@_try_declaring_generic_hook:wn}
 %<latexrelease>                 {Standardise~generic~hook~names}
-%<latexrelease>\prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn
+%<latexrelease>\prg_new_protected_conditional:Npnn
+%<latexrelease>    \@@_try_declaring_generic_hook:wn
 %<latexrelease>    #1 / #2 / #3 / #4 \scan_stop: #5 { TF }
 %<latexrelease>  {
 %<latexrelease>    \@@_if_generic:nTF {#5}
@@ -4083,9 +4129,11 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-%<latexrelease>\IncludeInRelease{2021/06/01}{\@@_try_declaring_generic_hook:wn}
+%<latexrelease>\IncludeInRelease{2021/06/01}
+%<latexrelease>                 {\@@_try_declaring_generic_hook:wn}
 %<latexrelease>                 {Support~cmd~hooks}
-%<latexrelease>\prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn
+%<latexrelease>\prg_new_protected_conditional:Npnn
+%<latexrelease>    \@@_try_declaring_generic_hook:wn
 %<latexrelease>    #1 / #2 / #3 / #4 \scan_stop: #5 { TF }
 %<latexrelease>  {
 %<latexrelease>    \tl_if_empty:nTF {#2}
@@ -4099,10 +4147,12 @@
 %<latexrelease>                  { \@@_try_put_cmd_hook:n {#5} }
 %<latexrelease>                \@@_make_usable:n {#5}
 %<latexrelease>              }
-%<latexrelease>            \prop_if_in:NnTF \c_@@_generics_reversed_ii_prop {#2}
+%<latexrelease>            \prop_if_in:NnTF
+%<latexrelease>              \c_@@_generics_reversed_ii_prop {#2}
 %<latexrelease>              { \tl_gset:cn { g_@@_#5_reversed_tl } { - } }
 %<latexrelease>              {
-%<latexrelease>                \prop_if_in:NnT \c_@@_generics_reversed_iii_prop {#3}
+%<latexrelease>                \prop_if_in:NnT
+%<latexrelease>                  \c_@@_generics_reversed_iii_prop {#3}
 %<latexrelease>                  { \tl_gset:cn { g_@@_#5_reversed_tl } { - } }
 %<latexrelease>              }
 %<latexrelease>            \prg_return_true:
@@ -4114,9 +4164,11 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_try_declaring_generic_hook:wn}
+%<latexrelease>\IncludeInRelease{2020/10/01}
+%<latexrelease>                 {\@@_try_declaring_generic_hook:wn}
 %<latexrelease>                 {Support~cmd~hooks}
-%<latexrelease>\prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn
+%<latexrelease>\prg_new_protected_conditional:Npnn
+%<latexrelease>    \@@_try_declaring_generic_hook:wn
 %<latexrelease>    #1 / #2 / #3 / #4 \scan_stop: #5 { TF }
 %<latexrelease>  {
 %<latexrelease>    \tl_if_empty:nTF {#2}
@@ -4125,10 +4177,12 @@
 %<latexrelease>        \prop_if_in:NnTF \c_@@_generics_prop {#1}
 %<latexrelease>          {
 %<latexrelease>            \@@_if_declared:nF {#5} { \hook_new:n {#5} }
-%<latexrelease>            \prop_if_in:NnTF \c_@@_generics_reversed_ii_prop {#2}
+%<latexrelease>            \prop_if_in:NnTF
+%<latexrelease>              \c_@@_generics_reversed_ii_prop {#2}
 %<latexrelease>              { \tl_gset:cn { g_@@_#5_reversed_tl } { - } }
 %<latexrelease>              {
-%<latexrelease>                \prop_if_in:NnT \c_@@_generics_reversed_iii_prop {#3}
+%<latexrelease>                \prop_if_in:NnT
+%<latexrelease>                  \c_@@_generics_reversed_iii_prop {#3}
 %<latexrelease>                  { \tl_gset:cn { g_@@_#5_reversed_tl } { - } }
 %<latexrelease>              }
 %<latexrelease>            \prg_return_true:
@@ -4204,11 +4258,11 @@
 %   \changes{v1.0h}{2021/01/07}{Assume hook name has at least three
 %     nonempty parts (gh/464)}
 %    \begin{macrocode}
-%<latexrelease>\cs_new:Npn \@@_strip_double_slash:w #1/#2/#3 // #4 \s_@@_mark
+%<latexrelease>\cs_new:Npn \@@_strip_double_slash:w #1/#2/#3//#4\s_@@_mark
 %<latexrelease>  {
 %<latexrelease>    \tl_if_empty:nTF {#4}
 %<latexrelease>      { #1/#2/#3 }
-%<latexrelease>      { \@@_strip_double_slash:w #1/#2/#3 / #4 \s_@@_mark }
+%<latexrelease>      { \@@_strip_double_slash:w #1/#2/#3 /#4\s_@@_mark }
 %<latexrelease>  }
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
@@ -4287,9 +4341,12 @@
 %    \begin{macrocode}
 %<latexrelease>\IncludeInRelease{2020/10/01}{\c_@@_generics_reversed_ii_prop}
 %<latexrelease>                 {Standardise~generic~hook~names}
-%<latexrelease>\prop_const_from_keyval:Nn \c_@@_generics_reversed_ii_prop {after=,end=}
-%<latexrelease>\prop_const_from_keyval:Nn \c_@@_generics_reversed_iii_prop {after=}
-%<latexrelease>\prop_const_from_keyval:Nn \c_@@_generics_file_prop {before=,after=}
+%<latexrelease>\prop_const_from_keyval:Nn
+%<latexrelease>    \c_@@_generics_reversed_ii_prop {after=,end=}
+%<latexrelease>\prop_const_from_keyval:Nn
+%<latexrelease>    \c_@@_generics_reversed_iii_prop {after=}
+%<latexrelease>\prop_const_from_keyval:Nn
+%<latexrelease>    \c_@@_generics_file_prop {before=,after=}
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
 %  \end{macro}
@@ -4369,7 +4426,8 @@
             \str_if_eq:nnTF {#2} { top-level }
               { \@@_toplevel_gset:nn {#1} { } }
               {
-                \prop_gpop:cnNF { g_@@_#1_code_prop } {#2} \l_@@_return_tl
+                \prop_gpop:cnNF { g_@@_#1_code_prop }
+                  {#2} \l_@@_return_tl
                   { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} }
               }
           }
@@ -4387,7 +4445,8 @@
         \@@_if_deprecated_generic:nTF {#1}
           {
             \@@_deprecated_generic_warn:n {#1}
-            \@@_do_deprecated_generic:Nn \@@_gremove_code:nn {#1} {#2}
+            \@@_do_deprecated_generic:Nn
+                \@@_gremove_code:nn {#1} {#2}
           }
           { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} }
       }
@@ -4412,8 +4471,10 @@
 %<latexrelease>            \str_if_eq:nnTF {#2} { top-level }
 %<latexrelease>              { \@@_tl_gclear:c { @@_toplevel~#1 } }
 %<latexrelease>              {
-%<latexrelease>                \prop_gpop:cnNF { g_@@_#1_code_prop } {#2} \l_@@_return_tl
-%<latexrelease>                  { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} }
+%<latexrelease>                \prop_gpop:cnNF { g_@@_#1_code_prop }
+%<latexrelease>                  {#2} \l_@@_return_tl
+%<latexrelease>                  { \msg_warning:nnnn { hooks } { cannot-remove }
+%<latexrelease>                                      {#1} {#2} }
 %<latexrelease>              }
 %<latexrelease>          }
 %<latexrelease>        \@@_if_usable:nT {#1}
@@ -4423,9 +4484,11 @@
 %<latexrelease>        \@@_if_deprecated_generic:nTF {#1}
 %<latexrelease>          {
 %<latexrelease>            \@@_deprecated_generic_warn:n {#1}
-%<latexrelease>            \@@_do_deprecated_generic:Nn \@@_gremove_code:nn {#1} {#2}
+%<latexrelease>            \@@_do_deprecated_generic:Nn
+%<latexrelease>                \@@_gremove_code:nn {#1} {#2}
 %<latexrelease>          }
-%<latexrelease>          { \msg_warning:nnnn { hooks } { cannot-remove } {#1} {#2} }
+%<latexrelease>          { \msg_warning:nnnn { hooks } { cannot-remove }
+%<latexrelease>                              {#1} {#2} }
 %<latexrelease>      }
 %<latexrelease>  }
 %<latexrelease>\EndIncludeInRelease
@@ -4467,7 +4530,8 @@
         {#1} {#2}
   }
 \cs_new_protected:Npn \@@_cs_gput_right_fast:nnn #1 #2 #3
-  { \cs_gset:cpx { @@#1~#2 } { \exp_not:v { @@#1~#2 } \exp_not:n {#3} } }
+  { \cs_gset:cpx { @@#1~#2 }
+      { \exp_not:v { @@#1~#2 } \exp_not:n {#3} } }
 \cs_new_protected:Npn \@@_cs_gput_right_slow:nnn #1 #2 #3
   {
 %    \end{macrocode}
@@ -4693,7 +4757,8 @@
 %    \begin{macrocode}
     \exp_last_unbraced:NNf
     \cs_set:Npn \@@_tmp:w { \@@_parameter:n {#1} } { }
-    \tl_set:Ne \l_@@_tmpa_tl { \@@_braced_cs_parameter:n { @@_tmp:w } }
+    \tl_set:Ne \l_@@_tmpa_tl
+      { \@@_braced_cs_parameter:n { @@_tmp:w } }
 %    \end{macrocode}
 %   Now this function does the fun part.  It is meant to be used with
 %   \cs{prop_map_function:NN}, taking a label name in \verb|##1| and the
@@ -5069,8 +5134,8 @@
 %<latexrelease>    \@@_if_deprecated_generic:nT {#1}
 %<latexrelease>      {
 %<latexrelease>        \@@_deprecated_generic_warn:n {#1}
-%<latexrelease>        \@@_do_deprecated_generic:Nn \@@_gset_rule:nnnn {#1}
-%<latexrelease>          {#2} {#3} {#4}
+%<latexrelease>        \@@_do_deprecated_generic:Nn \@@_gset_rule:nnnn
+%<latexrelease>          {#1} {#2} {#3} {#4}
 %<latexrelease>        \exp_after:wN \use_none:nnnnnnnnn \use_none:n
 %<latexrelease>      }
 %<latexrelease>    \@@_init_structure:n {#1}
@@ -5110,7 +5175,8 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_rule_before_gset:nnn #1#2#3
   {
-    \@@_tl_gset:cx { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
+    \@@_tl_gset:cx
+      { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
       { \@@_label_ordered:nnTF {#2} {#3} { < } { > } }
   }
 \cs_new_eq:cN { @@_rule_<_gset:nnn } \@@_rule_before_gset:nnn
@@ -5119,7 +5185,8 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_rule_after_gset:nnn #1#2#3
   {
-    \@@_tl_gset:cx { g_@@_#1_rule_ \@@_label_pair:nn {#3} {#2} _tl }
+    \@@_tl_gset:cx
+      { g_@@_#1_rule_ \@@_label_pair:nn {#3} {#2} _tl }
       { \@@_label_ordered:nnTF {#3} {#2} { < } { > } }
   }
 \cs_new_eq:cN { @@_rule_>_gset:nnn } \@@_rule_after_gset:nnn
@@ -5132,7 +5199,8 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_rule_voids_gset:nnn #1#2#3
   {
-    \@@_tl_gset:cx { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
+    \@@_tl_gset:cx
+      { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
       { \@@_label_ordered:nnTF {#2} {#3} { -> } { <- } }
   }
 %    \end{macrocode}
@@ -5146,11 +5214,15 @@
 %   together in hook |#1|.
 %    \begin{macrocode}
 \cs_new_protected:cpn { @@_rule_incompatible-error_gset:nnn } #1#2#3
-  { \@@_tl_gset:cn { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
-                   { xE } }
+  { \@@_tl_gset:cn
+      { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
+      { xE }
+  }
 \cs_new_protected:cpn { @@_rule_incompatible-warning_gset:nnn } #1#2#3
-  { \@@_tl_gset:cn { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
-                   { xW } }
+  { \@@_tl_gset:cn
+      { g_@@_#1_rule_ \@@_label_pair:nn {#2} {#3} _tl }
+      { xW }
+  }
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -5268,7 +5340,7 @@
       }
 %    \end{macrocode}
 %    After all hooks are initialized we change the ``use'' to just
-%    call the hook code and not initialize it (as it was done in the
+%    call the hook code and not initialize it (as this was already done in the
 %    preamble.
 %    \begin{macrocode}
     \@@_post_initialization_defs:
@@ -5281,7 +5353,8 @@
 %<latexrelease>                 {Hooks~with~args}
 %<latexrelease>\cs_gset_protected:Npn \@@_initialize_all:
 %<latexrelease>  {
-%<latexrelease>    \cs_gset_eq:NN \@@_update_hook_code:n \@@_initialize_hook_code:n
+%<latexrelease>    \cs_gset_eq:NN \@@_update_hook_code:n
+%<latexrelease>                   \@@_initialize_hook_code:n
 %<latexrelease>    \@@_debug:n { \prop_gclear:N \g_@@_used_prop }
 %<latexrelease>    \seq_map_inline:Nn \g_@@_all_seq
 %<latexrelease>      { \@@_update_hook_code:n {##1} }
@@ -5291,7 +5364,8 @@
 %<latexrelease>        \prop_map_inline:Nn \g_@@_used_prop
 %<latexrelease>          {
 %<latexrelease>            \iow_term:x
-%<latexrelease>              { ^^J ~ ##1 ~ -> ~ \cs_replacement_spec:c { @@~##1 } ~ }
+%<latexrelease>              { ^^J ~ ##1 ~ -> ~
+%<latexrelease>                \cs_replacement_spec:c { @@~##1 } ~ }
 %<latexrelease>          }
 %<latexrelease>      }
 %<latexrelease>    \cs_gset_eq:NN \hook_use:n \@@_use_initialized:n
@@ -5350,8 +5424,10 @@
 %   after the \verb|_next| and \verb|_toplevel| macros, so that the
 %   arguments passed to the hook are forwarded to them.
 %    \begin{macrocode}
-                \exp_not:c { @@_toplevel~#1 } \@@_braced_parameter:n {#1}
-                \exp_not:c { @@_next~#1 } \@@_braced_parameter:n {#1}
+                \exp_not:c { @@_toplevel~#1 }
+                \@@_braced_parameter:n {#1}
+                \exp_not:c { @@_next~#1 }
+                \@@_braced_parameter:n {#1}
               }
           }
           {
@@ -5400,7 +5476,8 @@
 %<latexrelease>\cs_gset_protected:Npn \@@_initialize_hook_code:n #1
 %<latexrelease>  {
 %<latexrelease>    \@@_debug:n
-%<latexrelease>      { \iow_term:x { ^^J Update~code~for~hook~'#1' \on@line :^^J } }
+%<latexrelease>      { \iow_term:x { ^^J Update~code~for~hook~'#1'
+%<latexrelease>                      \on@line :^^J } }
 %<latexrelease>    \@@_include_legacy_code_chunk:n {#1}
 %<latexrelease>    \@@_if_usable:nT {#1}
 %<latexrelease>      {
@@ -5414,15 +5491,21 @@
 %<latexrelease>          }
 %<latexrelease>          {
 %<latexrelease>            \@@_if_reversed:nTF {#1}
-%<latexrelease>              { \cs_set_eq:NN \@@_tl_gput:Nn    \@@_tl_gput_left:Nn
-%<latexrelease>                \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_left:NV  }
-%<latexrelease>              { \cs_set_eq:NN \@@_tl_gput:Nn    \@@_tl_gput_right:Nn
-%<latexrelease>                \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_right:NV }
-%<latexrelease>            \prop_set_eq:Nc \l_@@_work_prop { g_@@_#1_code_prop }
+%<latexrelease>              { \cs_set_eq:NN \@@_tl_gput:Nn
+%<latexrelease>                              \@@_tl_gput_left:Nn
+%<latexrelease>                \cs_set_eq:NN \@@_clist_gput:NV
+%<latexrelease>                              \clist_gput_left:NV  }
+%<latexrelease>              { \cs_set_eq:NN \@@_tl_gput:Nn
+%<latexrelease>                              \@@_tl_gput_right:Nn
+%<latexrelease>                \cs_set_eq:NN \@@_clist_gput:NV
+%<latexrelease>                              \clist_gput_right:NV }
+%<latexrelease>            \prop_set_eq:Nc \l_@@_work_prop
+%<latexrelease>              { g_@@_#1_code_prop }
 %<latexrelease>            \@@_initialize_single:ccn
 %<latexrelease>              { @@~#1 } { g_@@_#1_labels_clist } {#1}
 %<latexrelease>            \@@_debug:n
-%<latexrelease>              { \exp_args:NNx \prop_gput:Nnn \g_@@_used_prop {#1} { } }
+%<latexrelease>              { \exp_args:NNx \prop_gput:Nnn \g_@@_used_prop
+%<latexrelease>                    {#1} { } }
 %<latexrelease>          }
 %<latexrelease>      }
 %<latexrelease>  }
@@ -5621,7 +5704,8 @@
             \int_compare:nNnT
                 { \cs:w \@@_tl_csname:n {##1} \cs_end: } = 0
                 {
-                  \tl_set:cn { \@@_tl_csname:n { \l_@@_rear_tl } } {##1}
+                  \tl_set:cn
+                    { \@@_tl_csname:n { \l_@@_rear_tl } } {##1}
                   \tl_set:Nn \l_@@_rear_tl            {##1}
                 }
           }
@@ -5703,42 +5787,50 @@
 %<latexrelease>                  {#3}
 %<latexrelease>          }
 %<latexrelease>      }
-%<latexrelease>    \@@_debug:n { \@@_debug_label_data:N \l_@@_work_prop }
+%<latexrelease>    \@@_debug:n
+%<latexrelease>      { \@@_debug_label_data:N \l_@@_work_prop }
 %<latexrelease>    \tl_set:Nn \l_@@_rear_tl { 0 }
 %<latexrelease>    \tl_set:cn { \@@_tl_csname:n { 0 } } { 0 }
 %<latexrelease>    \seq_map_inline:Nn \l_@@_labels_seq
 %<latexrelease>      {
-%<latexrelease>        \int_compare:nNnT { \cs:w \@@_tl_csname:n {##1} \cs_end: } = 0
-%<latexrelease>            {
-%<latexrelease>              \tl_set:cn { \@@_tl_csname:n { \l_@@_rear_tl } }{##1}
-%<latexrelease>              \tl_set:Nn \l_@@_rear_tl {##1}
-%<latexrelease>            }
+%<latexrelease>        \int_compare:nNnT
+%<latexrelease>          { \cs:w \@@_tl_csname:n {##1} \cs_end: } = 0
+%<latexrelease>          {
+%<latexrelease>            \tl_set:cn { \@@_tl_csname:n 
+%<latexrelease>                           { \l_@@_rear_tl } } {##1}
+%<latexrelease>            \tl_set:Nn \l_@@_rear_tl           {##1}
+%<latexrelease>          }
 %<latexrelease>      }
 %<latexrelease>    \tl_set_eq:Nc \l_@@_front_tl { \@@_tl_csname:n { 0 } }
 %<latexrelease>    \@@_tl_gclear:N #1
 %<latexrelease>    \clist_gclear:N #2
-%<latexrelease>    \bool_while_do:nn { ! \str_if_eq_p:Vn \l_@@_front_tl { 0 } }
+%<latexrelease>    \bool_while_do:nn
+%<latexrelease>      { ! \str_if_eq_p:Vn \l_@@_front_tl { 0 } }
 %<latexrelease>      {
 %<latexrelease>        \int_decr:N \l_@@_labels_int
-%<latexrelease>        \prop_get:NVN \l_@@_work_prop \l_@@_front_tl \l_@@_return_tl
+%<latexrelease>        \prop_get:NVN \l_@@_work_prop
+%<latexrelease>            \l_@@_front_tl \l_@@_return_tl
 %<latexrelease>        \exp_args:NNV \@@_tl_gput:Nn #1 \l_@@_return_tl
 %<latexrelease>        \@@_clist_gput:NV #2 \l_@@_front_tl
-%<latexrelease>        \@@_debug:n{ \iow_term:x{Handled~ code~ for~ \l_@@_front_tl} }
-%<latexrelease>        \seq_map_inline:cn { \@@_seq_csname:n { \l_@@_front_tl } }
+%<latexrelease>        \@@_debug:n{ \iow_term:x
+%<latexrelease>              {Handled~ code~ for~ \l_@@_front_tl} }
+%<latexrelease>        \seq_map_inline:cn
+%<latexrelease>              { \@@_seq_csname:n { \l_@@_front_tl } }
 %<latexrelease>          {
 %<latexrelease>            \tl_set:cx { \@@_tl_csname:n {##1} }
-%<latexrelease>                       { \int_eval:n
-%<latexrelease>                           { \cs:w \@@_tl_csname:n {##1} \cs_end: - 1 }
-%<latexrelease>                       }
+%<latexrelease>              { \int_eval:n
+%<latexrelease>                { \cs:w \@@_tl_csname:n {##1} \cs_end: - 1 }
+%<latexrelease>              }
 %<latexrelease>            \int_compare:nNnT
-%<latexrelease>                { \cs:w \@@_tl_csname:n {##1} \cs_end: } = 0
-%<latexrelease>                {
-%<latexrelease>                  \tl_set:cn { \@@_tl_csname:n { \l_@@_rear_tl } } {##1}
-%<latexrelease>                  \tl_set:Nn \l_@@_rear_tl            {##1}
-%<latexrelease>                }
+%<latexrelease>              { \cs:w \@@_tl_csname:n {##1} \cs_end: } = 0
+%<latexrelease>              {
+%<latexrelease>                \tl_set:cn { \@@_tl_csname:n
+%<latexrelease>                               { \l_@@_rear_tl } } {##1}
+%<latexrelease>                \tl_set:Nn \l_@@_rear_tl           {##1}
+%<latexrelease>              }
 %<latexrelease>          }
 %<latexrelease>        \tl_set_eq:Nc \l_@@_front_tl
-%<latexrelease>                      { \@@_tl_csname:n { \l_@@_front_tl } }
+%<latexrelease>          { \@@_tl_csname:n { \l_@@_front_tl } }
 %<latexrelease>      }
 %<latexrelease>    \int_compare:nNnF \l_@@_labels_int = 0
 %<latexrelease>      {
@@ -5747,7 +5839,8 @@
 %<latexrelease>        \@@_debug_label_data:N \l_@@_work_prop
 %<latexrelease>        \iow_term:x{====================}
 %<latexrelease>      }
-%<latexrelease>    \exp_args:NNo \@@_tl_gput:Nn #1 { \cs:w @@_toplevel~#3 \cs_end: }
+%<latexrelease>    \exp_args:NNo \@@_tl_gput:Nn #1
+%<latexrelease>                    { \cs:w @@_toplevel~#3 \cs_end: }
 %<latexrelease>    \@@_tl_gput_right:No #1 { \cs:w @@_next~#3 \cs_end: }
 %<latexrelease>  }
 %<latexrelease>\cs_generate_variant:Nn \@@_tl_gput_right:Nn { No }
@@ -6008,6 +6101,8 @@
 %
 % \changes{v1.1a}{2023/04/06}
 %         {Changes to add hook arguments (hook-args).}
+% \changes{v1.1g}{2024/01/03}
+%         {Fix expansion of \cs{@@_print_args:nn} argument (gh/1221).}
 %    \begin{macrocode}
 %<latexrelease>\IncludeInRelease{2023/06/01}{\@@_log:nN}
 %<latexrelease>                 {Hooks~with~args}
@@ -6027,7 +6122,7 @@
         hook~'#1'
         \@@_if_disabled:nF {#1}
           {
-            \exp_args:Nf \@@_print_args:nn {#1}
+            \exp_args:Nne \@@_print_args:nn {#1}
               {
                 \int_eval:n
                   { \str_count:e { \@@_parameter:n {#1} } / 3 }
@@ -6164,7 +6259,8 @@
 %<latexrelease>      }
 %<latexrelease>    \@@_preamble_hook:n {#1}
 %<latexrelease>    \@@_log_cmd:x
-%<latexrelease>      { ^^J ->~The~ \@@_if_generic:nT {#1} { generic~ } hook~'#1': }
+%<latexrelease>      { ^^J ->~The~ \@@_if_generic:nT
+%<latexrelease>                      {#1} { generic~ } hook~'#1': }
 %<latexrelease>    \@@_if_usable:nF {#1}
 %<latexrelease>      { \@@_log_line:x { The~hook~is~not~declared. } }
 %<latexrelease>    \@@_if_disabled:nT {#1}
@@ -6177,26 +6273,30 @@
 %<latexrelease>          { \@@_log_line_indent:x { --- } }
 %<latexrelease>          {
 %<latexrelease>            \prop_map_inline:cn { g_@@_#1_code_prop }
-%<latexrelease>              { \@@_log_line_indent:x { ##1~->~\tl_to_str:n {##2} } }
+%<latexrelease>              { \@@_log_line_indent:x
+%<latexrelease>                  { ##1~->~\tl_to_str:n {##2} } }
 %<latexrelease>          }
 %<latexrelease>        \@@_log_line:x
 %<latexrelease>          {
 %<latexrelease>            Document-level~(top-level)~code
 %<latexrelease>            \@@_if_usable:nT {#1}
-%<latexrelease>              { ~(executed~\@@_if_reversed:nTF {#1} {first} {last} ) } :
+%<latexrelease>              { ~(executed~
+%<latexrelease>                \@@_if_reversed:nTF {#1} {first} {last} ) } :
 %<latexrelease>          }
 %<latexrelease>        \@@_log_line_indent:x
 %<latexrelease>          {
 %<latexrelease>            \tl_if_empty:cTF { @@_toplevel~#1 }
 %<latexrelease>              { --- }
-%<latexrelease>              { -> ~ \exp_args:Nv \tl_to_str:n { @@_toplevel~#1 } }
+%<latexrelease>              { -> ~ \exp_args:Nv \tl_to_str:n
+%<latexrelease>                                  { @@_toplevel~#1 } }
 %<latexrelease>          }
 %<latexrelease>        \@@_log_line:x { Extra~code~for~next~invocation: }
 %<latexrelease>        \@@_log_line_indent:x
 %<latexrelease>          {
 %<latexrelease>            \tl_if_empty:cTF { @@_next~#1 }
 %<latexrelease>              { --- }
-%<latexrelease>              { ->~ \exp_args:Nv \@@_log_next_code:n { @@_next~#1 } }
+%<latexrelease>              { ->~ \exp_args:Nv \@@_log_next_code:n
+%<latexrelease>                                   { @@_next~#1 } }
 %<latexrelease>          }
 %<latexrelease>        \@@_log_line:x { Rules: }
 %<latexrelease>        \bool_set_true:N \l_@@_tmpa_bool
@@ -6220,7 +6320,8 @@
 %<latexrelease>              {
 %<latexrelease>                Execution~order
 %<latexrelease>                \bool_if:NTF \l_@@_tmpa_bool
-%<latexrelease>                  { \@@_if_reversed:nT {#1} { ~(after~reversal) } }
+%<latexrelease>                  { \@@_if_reversed:nT
+%<latexrelease>                       {#1}{ ~(after~reversal) } }
 %<latexrelease>                  { ~(after~
 %<latexrelease>                    \@@_if_reversed:nT {#1} { reversal~and~ }
 %<latexrelease>                    applying~rules)
@@ -6231,16 +6332,19 @@
 %<latexrelease>                \@spaces
 %<latexrelease>                \clist_if_empty:cTF { g_@@_#1_labels_clist }
 %<latexrelease>                  { --- }
-%<latexrelease>                  { \clist_use:cn { g_@@_#1_labels_clist } { ,~ } }
+%<latexrelease>                  { \clist_use:cn
+%<latexrelease>                      { g_@@_#1_labels_clist } { ,~ } }
 %<latexrelease>              }
 %<latexrelease>          }
 %<latexrelease>          {
 %<latexrelease>            \@@_log_line:x { Execution~order: }
 %<latexrelease>            #2
 %<latexrelease>              {
-%<latexrelease>                \@spaces Not~set~because~the~hook~ \@@_if_usable:nTF {#1}
+%<latexrelease>                \@spaces Not~set~because~the~hook~
+%<latexrelease>                    \@@_if_usable:nTF {#1}
 %<latexrelease>                  { code~pool~is~empty }
-%<latexrelease>                  { is~\@@_if_disabled:nTF {#1} {disabled} {undeclared} }
+%<latexrelease>                  { is~\@@_if_disabled:nTF
+%<latexrelease>                      {#1} {disabled} {undeclared} }
 %<latexrelease>              }
 %<latexrelease>          }
 %<latexrelease>      }
@@ -6388,7 +6492,8 @@
 %<latexrelease>\IncludeInRelease{2020/10/01}{\hook_gput_next_code:nn}
 %<latexrelease>                 {Hooks~with~args}
 %<latexrelease>\cs_gset_protected:Npn \hook_gput_next_code:nn #1
-%<latexrelease>  { \@@_normalize_hook_args:Nn \@@_gput_next_code:nn {#1} }
+%<latexrelease>  { \@@_normalize_hook_args:Nn
+%<latexrelease>        \@@_gput_next_code:nn {#1} }
 %<latexrelease>\cs_gset_protected:Npn \hook_gput_next_code_with_args:nn #1 #2 { }
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
@@ -6580,7 +6685,8 @@
 %<latexrelease>    \fi:
 %<latexrelease>    \cs:w @@~#1 \@@_use_end:
 %<latexrelease>  }
-%<latexrelease>\cs_new:Npn \@@_use_undefined:w #1 #2 @@~#3 \@@_use_end:
+%<latexrelease>\cs_new:Npn \@@_use_undefined:w
+%<latexrelease>    #1 #2 @@~#3 \@@_use_end:
 %<latexrelease>  {
 %<latexrelease>    #1 % fi
 %<latexrelease>    \@@_use:wn #3 / \s_@@_mark {#3}
@@ -6680,15 +6786,18 @@
 %
 % \changes{v1.0s}{2021/09/28}
 %                {Correct usage of older \cs{@@_if_file_hook:wTF} (gh/675)}
+% \changes{v1.1h}{2024/01/24}
+%                {Correct usage of older \cs{@@_if_file_hook:wTF} (gh/1243)}
 %    \begin{macrocode}
 %<latexrelease>\cs_new_protected:Npn \@@_try_file_hook:n #1
 %<latexrelease>  {
-%<latexrelease>    \@@_if_file_hook:wTF #1 / \s_@@_mark
+%<latexrelease>    \@@_if_file_hook:wTF #1 / / \s_@@_mark
 %<latexrelease>      {
 %<latexrelease>        \exp_args:Ne \@@_if_usable_use:n
 %<latexrelease>          { \exp_args:Ne \@@_file_hook_normalize:n {#1} }
 %<latexrelease>      }
-%<latexrelease>      { \@@_if_usable_use:n {#1} } % file/ generic hook (e.g. file/before)
+%<latexrelease>      { \@@_if_usable_use:n {#1} }
+%<latexrelease>            % file/ generic hook (e.g. file/before)
 %<latexrelease>  }
 %    \end{macrocode}
 %
@@ -6726,12 +6835,14 @@
 \cs_new_protected:Npn \hook_use_once:n #1
   {
     \@@_if_execute_immediately:nF {#1}
-      { \@@_normalize_hook_args:Nn \@@_use_once:nn { \use:n {#1} } { 0 } }
+      { \@@_normalize_hook_args:Nn \@@_use_once:nn
+          { \use:n {#1} } { 0 } }
   }
 \cs_new_protected:Npn \hook_use_once:nnw #1 #2
   {
     \@@_if_execute_immediately:nF {#1}
-      { \@@_normalize_hook_args:Nn \@@_use_once:nn { \use:n {#1} } {#2} }
+      { \@@_normalize_hook_args:Nn \@@_use_once:nn
+          { \use:n {#1} } {#2} }
   }
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
@@ -6743,7 +6854,8 @@
 %<latexrelease>\cs_gset_protected:Npn \hook_use_once:n #1
 %<latexrelease>  {
 %<latexrelease>    \@@_if_execute_immediately:nF {#1}
-%<latexrelease>      { \@@_normalize_hook_args:Nn \@@_use_once:n { \use:n {#1} } }
+%<latexrelease>      { \@@_normalize_hook_args:Nn \@@_use_once:n
+%<latexrelease>          { \use:n {#1} } }
 %<latexrelease>  }
 %<latexrelease>\cs_gset:Npn \hook_use_once:nnw #1 #2
 %<latexrelease>  { \use:c { use_none: \prg_replicate:nn {#2} { n } } }
@@ -6768,7 +6880,8 @@
 %   along with the next execution code.
 %    \begin{macrocode}
     \@@_replacing_args_false:
-    \@@_cs_gput_right:nnn { _next } {#1} { \@@_use_once_clear:n {#1} }
+    \@@_cs_gput_right:nnn { _next } {#1}
+      { \@@_use_once_clear:n {#1} }
     \@@_replacing_args_reset:
     \@@_if_usable:nTF {#1}
       { \@@_use_initialized:n {#1} }
@@ -7215,7 +7328,8 @@
   { Cannot~add~code~to~disabled~hook~'#1'. }
   {
     The~hook~'#1'~you~tried~to~add~code~to~was~previously~disabled~
-    with~\iow_char:N\\hook_disable_generic:n~or~\iow_char:N\\DisableGenericHook,~so~
+    with~\iow_char:N\\hook_disable_generic:n~or~
+    \iow_char:N\\DisableGenericHook,~so~
     it~cannot~have~code~added~to~it.
   }
 %    \end{macrocode}
@@ -7383,7 +7497,7 @@
 %<latexrelease>                 {Hooks~with~args}
 %<latexrelease>\cs_new_protected:Npn \NewHookWithArguments #1 #2 { }
 %<latexrelease>\cs_new_protected:Npn \NewReversedHookWithArguments #1 #2 { }
-%<latexrelease>\cs_new_protected:Npn \NewMirroredHookPairWithArguments #1 #2 #3 { }
+%<latexrelease>\cs_new_protected:Npn \NewMirroredHookPairWithArguments #1 #2 #3{}
 %<latexrelease>\EndIncludeInRelease
 %    \end{macrocode}
 %  \end{macro}
@@ -7835,7 +7949,8 @@
 %<latexrelease>            \exp_args:No \exp_not:o
 %<latexrelease>              {
 %<latexrelease>                \cs:w @@#1~#2 \exp_last_unbraced:Ne \cs_end:
-%<latexrelease>                  { \@@_braced_cs_parameter:n { @@#1~#2 } }
+%<latexrelease>                  { \@@_braced_cs_parameter:n
+%<latexrelease>                      { @@#1~#2 } }
 %<latexrelease>              }
 %<latexrelease>          }
 %<latexrelease>      }
-- 
cgit v1.2.3

