From 226626f0741a0837d0a4b9aa565787cb76fadbd8 Mon Sep 17 00:00:00 2001 From: PhelypeOleinik Date: Wed, 14 Dec 2022 01:48:43 -0300 Subject: [PATCH] Fix showing the contents of a hook Use \meaning instead of \detokenize\expandafter{} --- base/lthooks.dtx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/base/lthooks.dtx b/base/lthooks.dtx index a6237a680..7ad8339a3 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: }