[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh441: Test if exist rather than if empty (b11dabb4)

PhelypeOleinik phelype.oleinik at latex-project.org
Fri Dec 11 19:37:33 CET 2020


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh441
Link       : https://github.com/latex3/latex2e/commit/b11dabb4d386c233c37acc7723a2c1a78a61f933

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

commit b11dabb4d386c233c37acc7723a2c1a78a61f933
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Fri Dec 11 15:37:33 2020 -0300

    Test if exist rather than if empty


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

b11dabb4d386c233c37acc7723a2c1a78a61f933
 base/lthooks.dtx                       | 8 ++++++--
 base/testfiles-lthooks/lthooks-019.tlg | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 4bcc3e13..8822715f 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -1938,8 +1938,12 @@
 %    If there was already code in the |top-level| chunk, then reverse it
 %    (see definition of \cs{@@_hook_gput_code_do:nnn}).
 %    \begin{macrocode}
-    \tl_if_empty:cF { @@_toplevel~#1 }
-      { \tl_reverse:c { @@_toplevel~#1 } }
+    \tl_if_exist:cT { @@_toplevel~#1 }
+      {
+        \debug_suspend:
+        \tl_greverse:c { @@_toplevel~#1 }
+        \debug_resume:
+      }
     \@@_new:n {#1}
 %    \end{macrocode}
 %    If the hook already exists the above will generate an error
diff --git a/base/testfiles-lthooks/lthooks-019.tlg b/base/testfiles-lthooks/lthooks-019.tlg
index 7b586e77..f245e5fc 100644
--- a/base/testfiles-lthooks/lthooks-019.tlg
+++ b/base/testfiles-lthooks/lthooks-019.tlg
@@ -184,10 +184,10 @@ Data structure for label rules:
 Handled code for my1
 Handled code for my3
 Handled code for my2
+after A
 after C
 after D
 after B
-after A
 Update code for hook 'env/quote/after' on input line ...:
  default rule my3|my2: < found
 Code labels for sorting:





More information about the latex3-commits mailing list.