[latex3-commits] [git/LaTeX3-latex3-latex2e] l3debug: Only clear if the prop exists (7ffa677f)

PhelypeOleinik phelype.oleinik at latex-project.org
Mon May 16 23:10:46 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : l3debug
Link       : https://github.com/latex3/latex2e/commit/7ffa677fe34d3b0d71a0a2cd8c34930f6225d6a7

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

commit 7ffa677fe34d3b0d71a0a2cd8c34930f6225d6a7
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Mon May 16 18:10:46 2022 -0300

    Only clear if the prop exists


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

7ffa677fe34d3b0d71a0a2cd8c34930f6225d6a7
 base/changes.txt |  2 +-
 base/lthooks.dtx | 23 ++++++++---------------
 2 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 53f6c402..0f6f9538 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -9,7 +9,7 @@ are not part of the distribution.
 2022-05-13  Phelype Oleinik  <phelype.oleinik at latex-project.org>
 
 	* lthooks.dtx (subsection{Using the hook}):
-	Avoid l3debug error on an undeclared variable with \prop_gclear:c.
+	Avoid l3debug error on an undeclared variable in \hook_use_once:nnn.
 
 2022-05-08  Marcel Krüger  <Marcel.Krueger at latex-project.org>
 
diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index c5243e89..c0146ad3 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2195,16 +2195,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\@@_prop_gclear:c}
-%   Same as above.
-% \changes{v1.0u}{2022/05/13}{Add non-debug version of \cs{prop_gclear:c}}
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_prop_gclear:c #1
-  { \exp_args:Nc \@@_tl_gset_eq:NN {#1} \c_empty_prop }
-%    \end{macrocode}
-% \end{macro}
-%
-%
 %
 % \subsection{Providing new hooks}
 %
@@ -4859,16 +4849,19 @@
 %   clears the hook so that any further call to \cs{hook_use:n} or
 %   \cs{hook_use_once:n} will expand to nothing.
 % \changes{v1.0r}{2021/09/06}{Clean up after \cs{UseOneTimeHook} (gh/606)}
-% \changes{v1.0u}{2022/05/13}{Use non-debug version of \cs{prop_gclear:c}}
+% \changes{v1.0u}{2022/05/13}{Check if prop exists to avoid l3debug error}
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_use_once_set:n #1
   { \@@_tl_gset:cn { g_@@_#1_reversed_tl } { I } }
 \cs_new_protected:Npn \@@_use_once_clear:n #1
   {
-    \@@_tl_gclear:c { @@~#1 }
-    \@@_tl_gclear:c { @@_next~#1 }
-    \@@_tl_gclear:c { @@_toplevel~#1 }
-    \@@_prop_gclear:c { g_@@_#1_code_prop }
+    \prop_if_exist:cT { g_@@_#1_code_prop }
+      {
+        \@@_tl_gclear:c { @@~#1 }
+        \@@_tl_gclear:c { @@_next~#1 }
+        \@@_tl_gclear:c { @@_toplevel~#1 }
+        \prop_gclear:c { g_@@_#1_code_prop }
+      }
   }
 %    \end{macrocode}
 % \end{macro}





More information about the latex3-commits mailing list.