[latex3-commits] [git/LaTeX3-latex3-latex2e] gh648: Simplify generic hook name subcomponent test (c86e7c35)

PhelypeOleinik phelype.oleinik at latex-project.org
Mon Aug 16 05:58:28 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh648
Link       : https://github.com/latex3/latex2e/commit/c86e7c35579e956832965ed890e90fd699f3c865

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

commit c86e7c35579e956832965ed890e90fd699f3c865
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Mon Aug 16 00:58:28 2021 -0300

    Simplify generic hook name subcomponent test


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

c86e7c35579e956832965ed890e90fd699f3c865
 base/lthooks.dtx | 56 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 43 insertions(+), 13 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index f5f57b52..65188809 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2954,8 +2954,8 @@
 % \begin{macro}[TF]{\@@_try_declaring_generic_hook:wn}
 %
 %    \begin{macrocode}
-%<latexrelease>\IncludeInRelease{2021/06/01}%
-%<latexrelease>        {\@@_try_declaring_generic_hook:wn}{Support~cmd~hooks}
+%<latexrelease>\IncludeInRelease{2021/11/15}{\@@_try_declaring_generic_hook:wn}%
+%<latexrelease>                 {Standardise~generic~hook~names}
 \prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn
     #1 / #2 / #3 / #4 \scan_stop: #5 { TF }
   {
@@ -2987,12 +2987,9 @@
 %    \begin{macrocode}
                 \@@_make_usable:n {#5}
               }
-            \prop_if_in:NnTF \c_@@_generics_reversed_ii_prop {#2}
+            \prop_if_in:NnT \c_@@_generics_reversed_prop {#3}
+              { \tl_gset:cn { g_@@_#5_reversed_tl } { - } }
               { \tl_gset:cn { g_@@_#5_reversed_tl } { - } }
-              {
-                \prop_if_in:NnT \c_@@_generics_reversed_iii_prop {#3}
-                  { \tl_gset:cn { g_@@_#5_reversed_tl } { - } }
-              }
             \prg_return_true:
           }
           { \prg_return_false: }
@@ -3002,9 +2999,39 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-%<latexrelease>\IncludeInRelease{2020/10/01}%
-%<latexrelease>        {\@@_try_declaring_generic_hook:wn}{Support~cmd~hooks}
-%<latexrelease>
+%<latexrelease>\IncludeInRelease{2021/06/01}{\@@_try_declaring_generic_hook:wn}
+%<latexrelease>                 {Support~cmd~hooks}
+%<latexrelease>\prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn
+%<latexrelease>    #1 / #2 / #3 / #4 \scan_stop: #5 { TF }
+%<latexrelease>  {
+%<latexrelease>    \tl_if_empty:nTF {#2}
+%<latexrelease>      { \prg_return_false: }
+%<latexrelease>      {
+%<latexrelease>        \prop_if_in:NnTF \c_@@_generics_prop {#1}
+%<latexrelease>          {
+%<latexrelease>            \@@_if_usable:nF {#5}
+%<latexrelease>              {
+%<latexrelease>                \str_if_eq:nnT {#1} { cmd }
+%<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>              { \tl_gset:cn { g_@@_#5_reversed_tl } { - } }
+%<latexrelease>              {
+%<latexrelease>                \prop_if_in:NnT \c_@@_generics_reversed_iii_prop {#3}
+%<latexrelease>                  { \tl_gset:cn { g_@@_#5_reversed_tl } { - } }
+%<latexrelease>              }
+%<latexrelease>            \prg_return_true:
+%<latexrelease>          }
+%<latexrelease>          { \prg_return_false: }
+%<latexrelease>      }
+%<latexrelease>  }
+%<latexrelease>\EndIncludeInRelease
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_try_declaring_generic_hook:wn}%
+%<latexrelease>                 {Support~cmd~hooks}
 %<latexrelease>\prg_new_protected_conditional:Npnn \@@_try_declaring_generic_hook:wn
 %<latexrelease>    #1 / #2 / #3 / #4 \scan_stop: #5 { TF }
 %<latexrelease>  {
@@ -3116,12 +3143,15 @@
 %    \end{macrocode}
 %  \end{macro}
 %
-%  \begin{macro}{\c_@@_generics_reversed_ii_prop,
+%  \begin{macro}{\c_@@_generics_reversed_prop,
+%                \c_@@_generics_reversed_ii_prop,
 %                \c_@@_generics_reversed_iii_prop,
 %                \c_@@_generics_file_prop}
-%    Some of the generic hooks are supposed to use reverse ordering, these are
-%    the following (only the second or third sub-component is checked):
+%    Some of the generic hooks are supposed to use reverse ordering,
+%    these are the following (the |ii| and |iii| names are kept for the
+%    deprecation cycle):
 %    \begin{macrocode}
+\prop_const_from_keyval:Nn \c_@@_generics_reversed_prop {after=,end=}
 \prop_const_from_keyval:Nn \c_@@_generics_reversed_ii_prop {after=,end=}
 \prop_const_from_keyval:Nn \c_@@_generics_reversed_iii_prop {after=}
 \prop_const_from_keyval:Nn \c_@@_generics_file_prop {before=,after=}





More information about the latex3-commits mailing list.