[latex3-commits] [git/LaTeX3-latex3-latex2e] apdf161: Rename next code token list to "@@_next~<name>" (9aee1a11)
PhelypeOleinik
phelype.oleinik at latex-project.org
Thu Sep 10 15:25:21 CEST 2020
Repository : https://github.com/latex3/latex2e
On branch : apdf161
Link : https://github.com/latex3/latex2e/commit/9aee1a11892b231f73073bfa56f35dc0005c112e
>---------------------------------------------------------------
commit 9aee1a11892b231f73073bfa56f35dc0005c112e
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Thu Sep 10 10:25:21 2020 -0300
Rename next code token list to "@@_next~<name>"
>---------------------------------------------------------------
9aee1a11892b231f73073bfa56f35dc0005c112e
base/lthooks.dtx | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 8f37d17f..6df78af5 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -1639,7 +1639,7 @@
%
% \subsection{Providing new hooks}
%
-% \begin{macro}{\g_@@_..._code_prop,\@@~...,\g_@@_..._code_next_tl}
+% \begin{macro}{\g_@@_..._code_prop,\@@~...,\@@_next~...}
%
% Hooks have a \meta{name} and for each hook we have to provide a number of
% data structures. These are
@@ -1670,14 +1670,15 @@
% $\meta{reversed}1$ is $+1$ for normal hooks and $-1$ for reversed
% ones.
%
-% \item[\cs{g_@@_\meta{name}_code_next_tl}] Finally there is extra code
+% \item[\cs{@@_next~\meta{name}}] Finally there is extra code
% (normally empty) that is used on the next invocation of the hook
% (and then deleted). This can be used to define some special
% behavior for a single occasion from within the document. This token
-% list is called |code_next| rather than |next_code| because otherwise
-% a hook called \meta{name}|_next| would have its code-token list
-% named \cs[no-index]{g_@@_\meta{name}_code_next_tl}, which would
-% clash with the next code-token list of a hook called \meta{name}.
+% list follows the same naming scheme than the main \cs{@@~\meta{name}}
+% token list. It is called \cs{@@_next~\meta{name}} rather than
+% \cs{@@~next_\meta{name}} because otherwise a hook whose name is
+% |next_|\meta{name} would clash with the next code-token list of the
+% hook called \meta{name}.
%
% \end{description}
% \end{macro}
@@ -1760,7 +1761,7 @@
\@@_if_exist:nF {#1}
{
\prop_new:c { g_@@_#1_code_prop }
- \tl_new:c { g_@@_#1_code_next_tl }
+ \tl_new:c { @@_next~#1 }
}
}
% \end{macrocode}
@@ -2686,7 +2687,7 @@
{
\prop_if_empty:cTF {g_@@_#1_code_prop}
{ \tl_gset:co { @@~#1 }
- { \cs:w g_@@_#1_code_next_tl \cs_end: } }
+ { \cs:w @@_next~#1 \cs_end: } }
{
% \end{macrocode}
% By default the algorithm sorts the code chunks and then saves the
@@ -2710,7 +2711,7 @@
% \begin{macrocode}
\prop_set_eq:Nc \l_@@_work_prop { g_@@_#1_code_prop }
\@@_initialize_single:cccn
- { @@~#1 } { g_@@_#1_code_next_tl }
+ { @@~#1 } { @@_next~#1 }
{ g_@@_#1_labels_clist } {#1}
% \end{macrocode}
% For debug display we want to keep track of those hooks that
@@ -3206,7 +3207,7 @@
% \begin{macrocode}
\iow_term:x{~Extra~ code~ next~ invocation:}
\iow_term:x{\@spaces
- \tl_if_empty:cTF { g_@@_#1_code_next_tl }
+ \tl_if_empty:cTF { @@_next~#1 }
{---}
% \end{macrocode}
% If the token list is not empty we want to display it but without
@@ -3214,7 +3215,7 @@
% command to get rid of them.
% \begin{macrocode}
{->~ \exp_args:Nv
- \@@_log_next_code:n {g_@@_#1_code_next_tl} } }
+ \@@_log_next_code:n {@@_next~#1} } }
% \end{macrocode}
%
% Loop through the rules in a hook and for every rule found, print it.
@@ -3356,7 +3357,7 @@
\cs_new_protected:Npn \@@_gput_next_do:nn #1
{
\exp_args:Nc \@@_gput_next_do:Nnn
- { g_@@_#1_code_next_tl } {#1}
+ { @@_next~#1 } {#1}
}
% \end{macrocode}
% First check if the ``next code'' token list is empty: if so we need
@@ -3536,7 +3537,7 @@
% Test if a hook is empty (that is, no code was added to that hook).
% A hook being empty means that \emph{both} its
% \cs[no-index]{g_@@_\meta{hook}_code_prop} and its
-% \cs[no-index]{g_@@_\meta{hook}_code_next_tl} are empty.
+% \cs[no-index]{@@_next~\meta{hook}} are empty.
% \begin{macrocode}
\prg_new_conditional:Npnn \hook_if_empty:n #1 { p , T , F , TF }
{
@@ -3544,7 +3545,7 @@
{
\bool_lazy_and:nnTF
{ \prop_if_empty_p:c { g_@@_#1_code_prop } }
- { \tl_if_empty_p:c { g_@@_#1_code_next_tl } }
+ { \tl_if_empty_p:c { @@_next~#1 } }
{ \prg_return_true: }
{ \prg_return_false: }
}
More information about the latex3-commits
mailing list.