[latex3-commits] [git/LaTeX3-latex3-latex2e] hook-args: Fix showing the contents of a hook (226626f0)

PhelypeOleinik phelype.oleinik at latex-project.org
Wed Dec 14 05:48:43 CET 2022


Repository : https://github.com/latex3/latex2e
On branch  : hook-args
Link       : https://github.com/latex3/latex2e/commit/226626f0741a0837d0a4b9aa565787cb76fadbd8

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

commit 226626f0741a0837d0a4b9aa565787cb76fadbd8
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Wed Dec 14 01:48:43 2022 -0300

    Fix showing the contents of a hook
    
    Use \meaning<hook> instead of \detokenize\expandafter{<hook>}


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

226626f0741a0837d0a4b9aa565787cb76fadbd8
 base/lthooks.dtx | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index a6237a68..7ad8339a 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2102,6 +2102,7 @@
 \cs_generate_variant:Nn \tl_gremove_once:Nn { Nx }
 \cs_generate_variant:Nn \tl_show:n { x }
 \cs_generate_variant:Nn \tl_log:n { x }
+\cs_generate_variant:Nn \cs_replacement_spec:N { c }
 %    \end{macrocode}
 % \end{macro}
 %
@@ -3914,10 +3915,7 @@
       \prop_map_inline:Nn \g_@@_used_prop
         {
           \iow_term:x
-            {
-              ^^J ~ ##1 ~ -> ~
-               \exp_args:Nc \cs_replacement_spec:N { @@~##1 } ~
-            }
+            { ^^J ~ ##1 ~ -> ~ \cs_replacement_spec:c { @@~##1 } ~ }
         }
     }
 %    \end{macrocode}
@@ -4537,9 +4535,9 @@
           }
         \@@_log_line_indent:x
           {
-            \tl_if_empty:cTF { @@_toplevel~#1 }
+            \@@_cs_if_empty:cTF { @@_toplevel~#1 }
               { --- }
-              { -> ~ \exp_args:Nv \tl_to_str:n { @@_toplevel~#1 } }
+              { -> ~ \cs_replacement_spec:c { @@_toplevel~#1 } }
           }
 %    \end{macrocode}
 %
@@ -4547,7 +4545,7 @@
         \@@_log_line:x { Extra~code~for~next~invocation: }
         \@@_log_line_indent:x
           {
-            \tl_if_empty:cTF { @@_next~#1 }
+            \@@_cs_if_empty:cTF { @@_next~#1 }
               { --- }
 %    \end{macrocode}
 %
@@ -4749,8 +4747,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_gput_next_do:Nnn #1 #2
   {
-    \exp_args:Ne \str_if_empty:nT
-        { \exp_args:Nc \cs_replacement_spec:N { @@~#2 } }
+    \exp_args:Ne \str_if_empty:nT { \cs_replacement_spec:c { @@~#2 } }
       { \@@_update_hook_code:n {#2} }
     \tl_if_empty:NT #1
       { \@@_tl_gset:Nn #1 { \@@_clear_next:n {#2} } }
@@ -5032,8 +5029,8 @@
             { \prop_if_empty_p:c { g_@@_#1_code_prop } }
             {
               \bool_lazy_and_p:nn
-                { \tl_if_empty_p:c { @@_toplevel~#1 } }
-                { \tl_if_empty_p:c { @@_next~#1 } }
+                { \@@_cs_if_empty_p:c { @@_toplevel~#1 } }
+                { \@@_cs_if_empty_p:c { @@_next~#1 } }
             }
           { \prg_return_true: }
           { \prg_return_false: }





More information about the latex3-commits mailing list.