[latex3-commits] [git/LaTeX3-latex3-latex2e] apdf161: Move \debug_suspend: earlier (2579e231)

PhelypeOleinik phelype.oleinik at latex-project.org
Wed Sep 9 15:34:10 CEST 2020


Repository : https://github.com/latex3/latex2e
On branch  : apdf161
Link       : https://github.com/latex3/latex2e/commit/2579e231af8a858f9e163c62198154a610f67616

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

commit 2579e231af8a858f9e163c62198154a610f67616
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Wed Sep 9 10:34:10 2020 -0300

    Move \debug_suspend: earlier


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

2579e231af8a858f9e163c62198154a610f67616
 base/lthooks.dtx | 66 ++++++++++++++++++++++++++------------------------------
 1 file changed, 31 insertions(+), 35 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index c7a58d3e..3520ecd1 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2653,9 +2653,11 @@
 %    and at \verb=\begin{document}= this is done for all hooks and
 %    afterwards only if the hook code changes.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_initialize_hook_code:n #1 {
-  \@@_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~
-                                  '#1' \on at line :^^J} }
+\cs_new_protected:Npn \@@_initialize_hook_code:n #1
+  {
+    \debug_suspend:
+    \@@_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~
+                                    '#1' \on at line :^^J} }
 %    \end{macrocode}
 %    This does the sorting and the updates.
 %    First thing we do is to check if a legacy hook macro exists and
@@ -2663,7 +2665,7 @@
 %    might make the hook non-empty so we have to do this before
 %    the then following test.
 %    \begin{macrocode}
-  \@@_include_legacy_code_chunk:n {#1}
+    \@@_include_legacy_code_chunk:n {#1}
 %    \end{macrocode}
 %    If there aren't any code
 %    chunks for the current hook, there is no point in even starting
@@ -2674,12 +2676,12 @@
 %    as they are needed several times inside. This way we save a bit
 %    on processing time if we do that up front.
 %    \begin{macrocode}
-  \hook_if_exist:nT {#1}
-    {
-      \prop_if_empty:cTF {g_@@_#1_code_prop}
-        { \tl_gset:co {g_@@_#1_code_tl}
-                      {\cs:w g_@@_#1_code_next_tl \cs_end: } }
-        {
+    \hook_if_exist:nT {#1}
+      {
+        \prop_if_empty:cTF {g_@@_#1_code_prop}
+          { \tl_gset:co {g_@@_#1_code_tl}
+                        {\cs:w g_@@_#1_code_next_tl \cs_end: } }
+          {
 %    \end{macrocode}
 %    By default the algorithm sorts the code chunks and then saves the
 %    result in a token list for fast execution by adding the code one
@@ -2688,11 +2690,11 @@
 %    the opposite order into the token list. So all we have to do
 %    in preparation is to change two definitions used later on.
 %    \begin{macrocode}
-          \@@_if_reversed:nTF {#1}
-            { \cs_set_eq:NN \@@_tl_gput:NV    \tl_gput_left:NV
-              \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_left:NV  }
-            { \cs_set_eq:NN \@@_tl_gput:NV    \tl_gput_right:NV
-              \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_right:NV }
+            \@@_if_reversed:nTF {#1}
+              { \cs_set_eq:NN \@@_tl_gput:NV    \tl_gput_left:NV
+                \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_left:NV  }
+              { \cs_set_eq:NN \@@_tl_gput:NV    \tl_gput_right:NV
+                \cs_set_eq:NN \@@_clist_gput:NV \clist_gput_right:NV }
 %    \end{macrocode}
 %
 %    When sorting, some relations (namely \verb|voids|) need to
@@ -2700,10 +2702,10 @@
 %    shouldn't appear in the sorted hook token list, so we temporarily
 %    save the old code property list so that it can be restored later.
 %    \begin{macrocode}
-          \prop_set_eq:Nc \l_@@_work_prop { g_@@_#1_code_prop }
-          \@@_initialize_single:cccn
-            { g_@@_#1_code_tl } { g_@@_#1_code_next_tl }
-            { g_@@_#1_labels_clist } {#1}
+            \prop_set_eq:Nc \l_@@_work_prop { g_@@_#1_code_prop }
+            \@@_initialize_single:cccn
+              { g_@@_#1_code_tl } { g_@@_#1_code_next_tl }
+              { g_@@_#1_labels_clist } {#1}
 %    \end{macrocode}
 %    For debug display we want to keep track of those hooks that
 %    actually got code added to them, so we record that in plist. We
@@ -2711,11 +2713,12 @@
 %    i.e., we are only interested in storing the keys and the value is
 %    arbitrary.
 %    \begin{macrocode}
-          \@@_debug:n{ \exp_args:NNx \prop_gput:Nnn
-                                     \g_@@_used_prop {#1}{} }
-        }
-    }
-}
+            \@@_debug:n{ \exp_args:NNx \prop_gput:Nnn
+                                       \g_@@_used_prop {#1}{} }
+          }
+      }
+    \debug_resume:
+  }
 %    \end{macrocode}
 %  \end{macro}
 %
@@ -2788,11 +2791,8 @@
 %    the moment: a label can't be equal to the number 0!  \fmi{Needs
 %    checking for, just in case}
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_initialize_single:NNNn #1#2#3#4 {
-%    \end{macrocode}
-%    
-%    \begin{macrocode}
-  \debug_suspend:
+\cs_new_protected:Npn \@@_initialize_single:NNNn #1#2#3#4
+  {
 %    \end{macrocode}
 %    Step T1: Initialize the data structure \ldots
 %    \begin{macrocode}
@@ -2936,12 +2936,8 @@
 %    with adding extra code for a one time execution. That is stored
 %    in \verb=#2= but is normally empty.
 %    \begin{macrocode}
-  \tl_gput_right:Nn #1 {#2}
-%    \end{macrocode}
-%    
-%    \begin{macrocode}
-  \debug_resume:
-}
+    \tl_gput_right:Nn #1 {#2}
+  }
 %    \end{macrocode}
 %    
 %    \begin{macrocode}





More information about the latex3-commits mailing list.