[latex3-commits] [git/LaTeX3-latex3-latex2e] lthooks2: get back in sync (f6ee7e7e)

Frank Mittelbach frank.mittelbach at latex-project.org
Sat Aug 22 23:34:01 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : lthooks2
Link       : https://github.com/latex3/latex2e/commit/f6ee7e7edb68bc53581b37892eb71a031ec97eb8

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

commit f6ee7e7edb68bc53581b37892eb71a031ec97eb8
Merge: f5e6d98d 4af63feb
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Sat Aug 22 23:34:01 2020 +0200

    get back in sync


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

f6ee7e7edb68bc53581b37892eb71a031ec97eb8
 base/lthooks.dtx                       | 26 +++++++++++++++++++++++---
 base/testfiles-lthooks/lthooks-010.lvt |  9 +++++++--
 base/testfiles-lthooks/lthooks-010.tlg | 23 +++++++++++++++++------
 3 files changed, 47 insertions(+), 11 deletions(-)

diff --cc base/lthooks.dtx
index afdd0625,c31f3e19..873a5713
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@@ -3120,7 -3131,12 +3131,13 @@@
          \iow_term:x{~Extra~ code~ next~ invocation:}
          \iow_term:x{\@spaces
            \tl_if_empty:cTF { g_@@_#1_next_code_tl }
-             {---} {->~ \exp_args:Nv \@@_log_next_code:n {g_@@_#1_next_code_tl} } }
+              {---}
+ %    \end{macrocode}
+ %    If the token list is not empty we want to display it but without
 -%    the first two tokens (the code to clear itself)
++%    the first tokens (the code to clear itself) so we call a helper
++%    command to  get rid of them.
+ %    \begin{macrocode}
 -             {->~  \@@_log_next_code:v {g_@@_#1_next_code_tl} } }
++             {->~  \exp_args:Nv \@@_log_next_code:n {g_@@_#1_next_code_tl} } }
  %    \end{macrocode}
  %
  %   Loop through the rules in a hook and for every rule found, print it.
@@@ -3166,10 -3182,14 +3183,13 @@@
    }
  %    \end{macrocode}
  %
+ %    To display the code for next invocation only (i.e., from
+ %    \cs{AddToHookNext} we have to remove the first two tokens at the
+ %    front which are \cs{tl_gclear:N} and the token list to clear.
  %    \begin{macrocode}
  \cs_new:Npn \@@_log_next_code:n #1 {
 -  \exp_args:No \tl_to_str:n{\use_none:nn #1}    
 +  \exp_args:No \tl_to_str:n {\use_none:nn #1}
  }
 -\cs_generate_variant:Nn \@@_log_next_code:n { v }
  %    \end{macrocode}
  %  \end{macro}
  %





More information about the latex3-commits mailing list.