Skip to content

Commit

Permalink
Fix showing the contents of a hook
Browse files Browse the repository at this point in the history
Use \meaning<hook> instead of \detokenize\expandafter{<hook>}
  • Loading branch information
PhelypeOleinik committed Dec 14, 2022
1 parent a1ed479 commit 226626f
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions base/lthooks.dtx
Expand Up @@ -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}
%
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -4537,17 +4535,17 @@
}
\@@_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}
%
% \begin{macrocode}
\@@_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}
%
Expand Down Expand Up @@ -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} } }
Expand Down Expand Up @@ -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: }
Expand Down

0 comments on commit 226626f

Please sign in to comment.