[latex3-commits] [git/LaTeX3-latex3-latex2e] gh565-clearhooknext: Add argument normalisation for \hook_gclear_next_code:n (3d4f3b87)

PhelypeOleinik phelype.oleinik at latex-project.org
Wed Jul 28 02:23:43 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh565-clearhooknext
Link       : https://github.com/latex3/latex2e/commit/3d4f3b87a54dab8b5076563c89f0a454b07b58ab

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

commit 3d4f3b87a54dab8b5076563c89f0a454b07b58ab
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Tue Jul 27 21:23:43 2021 -0300

    Add argument normalisation for \hook_gclear_next_code:n


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

3d4f3b87a54dab8b5076563c89f0a454b07b58ab
 base/lthooks.dtx                       | 6 ++++--
 base/testfiles-lthooks/lthooks-009.tlg | 6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 614fe0cd..bae3a126 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -4314,7 +4314,7 @@
     \tl_if_empty:cT { @@~#2 }
       { \@@_update_hook_code:n {#2} }
     \tl_if_empty:NT #1
-      { \@@_tl_gset:Nn #1 { \hook_gclear_next_code:n {#2} } }
+      { \@@_tl_gset:Nn #1 { \@@_clear_next:n {#2} } }
     \@@_tl_gput_right:Nn #1
   }
 %    \end{macrocode}
@@ -4322,11 +4322,13 @@
 %
 %
 %
-%  \begin{macro}{\hook_gclear_next_code:n}
+%  \begin{macro}{\hook_gclear_next_code:n,\@@_clear_next:n}
 %    Discard anything set up for next invocation of the hook.
 % \changes{v1.0o}{2021/07/27}{Macro made public}
 %    \begin{macrocode}
 \cs_new_protected:Npn \hook_gclear_next_code:n #1
+  { \@@_normalize_hook_args:Nn \@@_clear_next:n {#1} }
+\cs_new_protected:Npn \@@_clear_next:n #1
   { \cs_gset_eq:cN { @@_next~#1 } \c_empty_tl }
 %    \end{macrocode}
 %  \end{macro}
diff --git a/base/testfiles-lthooks/lthooks-009.tlg b/base/testfiles-lthooks/lthooks-009.tlg
index c525c646..a7f02cab 100644
--- a/base/testfiles-lthooks/lthooks-009.tlg
+++ b/base/testfiles-lthooks/lthooks-009.tlg
@@ -136,7 +136,7 @@ Update code for hook 'hook' on input line ...:
 >     ---
 > Execution order:
 >     ---.
-Use 'hook': \hook_gclear_next_code:n {hook}Hello, \AddToHookNext {hook}{nested}world!
+Use 'hook': \__hook_clear_next:n {hook}Hello, \AddToHookNext {hook}{nested}world!
 -> The hook 'hook':
 > Code chunks:
 >     ---
@@ -148,7 +148,7 @@ Use 'hook': \hook_gclear_next_code:n {hook}Hello, \AddToHookNext {hook}{nested}w
 >     ---
 > Execution order:
 >     ---.
-and again: \hook_gclear_next_code:n {hook}Hello, \AddToHookNext {hook}{nested}world!
+and again: \__hook_clear_next:n {hook}Hello, \AddToHookNext {hook}{nested}world!
 -> The hook 'hook':
 > Code chunks:
 >     ---
@@ -160,7 +160,7 @@ and again: \hook_gclear_next_code:n {hook}Hello, \AddToHookNext {hook}{nested}wo
 >     ---
 > Execution order:
 >     ---.
-once more: \hook_gclear_next_code:n {hook}Hello, \AddToHookNext {hook}{nested}world!
+once more: \__hook_clear_next:n {hook}Hello, \AddToHookNext {hook}{nested}world!
 -> The hook 'hook':
 > Code chunks:
 >     ---





More information about the latex3-commits mailing list.