[latex3-commits] [latex3/latex2e] latexlab/rcb: changed to "named blocks" (incomplete) (b657ff16)

github at latex-project.org github at latex-project.org
Fri Jun 16 23:24:13 CEST 2023


Repository : https://github.com/latex3/latex2e
On branch  : latexlab/rcb
Link       : https://github.com/latex3/latex2e/commit/b657ff165ed354c06f963c62d3d6745b95e4ba06

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

commit b657ff165ed354c06f963c62d3d6745b95e4ba06
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Fri Jun 16 23:24:13 2023 +0200

    changed to "named blocks" (incomplete)


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

b657ff165ed354c06f963c62d3d6745b95e4ba06
 required/latex-lab/latex-lab-footnotes.dtx | 16 +++++------
 required/latex-lab/latex-lab-new-or-2.dtx  | 30 +++++++++----------
 required/latex-lab/latex-lab-rcb.dtx       | 46 ++++++++++++++++--------------
 3 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/required/latex-lab/latex-lab-footnotes.dtx b/required/latex-lab/latex-lab-footnotes.dtx
index 1c32423d..984fc4b2 100644
--- a/required/latex-lab/latex-lab-footnotes.dtx
+++ b/required/latex-lab/latex-lab-footnotes.dtx
@@ -2008,10 +2008,10 @@
 %    \texttt{dblfnote} package if we integrate that).
 %    \begin{macrocode}
 \ifFN at para
-  \DeclareRCBCode{@makecol/footnotes}{para}{%
+  \DeclareNamedBlockCode{@makecol/footnotes}{para}{%
      \global\setbox\footins\vbox{\FN at makefootnoteparagraph}%
     }
-  \AssignRCBCode{@makecol/footnotes}{para}
+  \AssignNamedBlockCode{@makecol/footnotes}{para}
 \fi
 %    \end{macrocode}
 %
@@ -2044,21 +2044,21 @@
   \ERROR
 \or %1
   \ifFN at abovefloats
-    \AssignRCBCode{@makecol/outputbox}{space-footnotes-floats}
+    \AssignNamedBlockCode{@makecol/outputbox}{space-footnotes-floats}
   \else
-    \AssignRCBCode{@makecol/outputbox}{floats-footnotes-space}
+    \AssignNamedBlockCode{@makecol/outputbox}{floats-footnotes-space}
   \fi
 \or %2
   \ifFN at abovefloats
-    \AssignRCBCode{@makecol/outputbox}{footnotes-space-floats}
+    \AssignNamedBlockCode{@makecol/outputbox}{footnotes-space-floats}
   \else
-    \AssignRCBCode{@makecol/outputbox}{space-floats-footnotes}
+    \AssignNamedBlockCode{@makecol/outputbox}{space-floats-footnotes}
   \fi
 \or %3
   \ifFN at abovefloats
-    \AssignRCBCode{@makecol/outputbox}{footnotes-floats}
+    \AssignNamedBlockCode{@makecol/outputbox}{footnotes-floats}
   \else
-    \AssignRCBCode{@makecol/outputbox}{floats-footnotes}
+    \AssignNamedBlockCode{@makecol/outputbox}{floats-footnotes}
   \fi
 \else
   \ERROR
diff --git a/required/latex-lab/latex-lab-new-or-2.dtx b/required/latex-lab/latex-lab-new-or-2.dtx
index 26886cb9..47d54c72 100644
--- a/required/latex-lab/latex-lab-new-or-2.dtx
+++ b/required/latex-lab/latex-lab-new-or-2.dtx
@@ -164,7 +164,7 @@
 %    Here we have the configurable part. It appends floats and
 %    footnotes as appropriate to the \cs{@outputbox}.
 %    \begin{macrocode}
-  \UseRCB{@makecol/outputbox}%
+  \UseNamedBlock{@makecol/outputbox}%
 %    \end{macrocode}
 %    The we deal with any \cs{enlargethispage} or run the normal code
 %    to build a column.
@@ -358,7 +358,7 @@
 % \fmi{this code will get revised as part of RCB handling  in the future}
 %    \begin{macrocode}
      \@makecol at handlesplitfootnotes
-     \UseRCB{@makecol/footnotes}%
+     \UseNamedBlock{@makecol/footnotes}%
 %    \end{macrocode}
 %    Then the footnotes are appended:
 %    \begin{macrocode}
@@ -438,14 +438,12 @@
 %
 %  \begin{macro}{\@makecol at cfgpointii}
 %
-%    RCB to support manipulation of \cs{footins} box
+%    Named code block to support manipulation of \cs{footins} box
 %    (result needs to be moved back in there). Used when footnotes are
 %    reformatted into a single paragraph by the
 %    \texttt{para} option of \pkg{footmisc}.
 %    \begin{macrocode}
-\NewRCB{@makecol/footnotes}{0}
-\DeclareRCBCode{@makecol/footnotes}{default}{}
-\AssignRCBCode{@makecol/footnotes}{default}
+\NewNamedBlock{@makecol/footnotes}{0}
 %    \end{macrocode}
 %
 %  \end{macro}
@@ -501,18 +499,18 @@
 %
 %
 %  \begin{macro}{@makecol/outputbox}
-%    We have one RCB that is supposed to augment the \cs{@outputbox}
+%    We have one named code block that is supposed to augment the \cs{@outputbox}
 %    by attching floats and footnotes with appropriate spacing
 %
 %    \begin{macrocode}
-\NewRCB{@makecol/outputbox}{0}
+\NewNamedBlock{@makecol/outputbox}{0}
 %    \end{macrocode}
 %  \end{macro}
 %
 %    The following named code alternatives are available:
 %
 %    \begin{macrocode}
-\DeclareRCBCode{@makecol/outputbox}{space-footnotes-floats} {%
+\DeclareNamedBlockCode{@makecol/outputbox}{space-footnotes-floats} {%
   \@if at footnotes@TF
       {\@outputbox at append{\vfill}}%
       {\@if at bfloats@TF
@@ -525,7 +523,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareRCBCode{@makecol/outputbox}{floats-footnotes-space} {%
+\DeclareNamedBlockCode{@makecol/outputbox}{floats-footnotes-space} {%
   \@outputbox at attachfloats
   \@if at footnotes@TF
       {\@outputbox at append{\vfill}}%
@@ -535,7 +533,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareRCBCode{@makecol/outputbox}{footnotes-space-floats} {%
+\DeclareNamedBlockCode{@makecol/outputbox}{footnotes-space-floats} {%
   \@outputbox at appendfootnotes
   \@if at bfloats@TF
       {\@outputbox at append{\vfill}}%
@@ -545,7 +543,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareRCBCode{@makecol/outputbox}{space-floats-footnotes} {%
+\DeclareNamedBlockCode{@makecol/outputbox}{space-floats-footnotes} {%
   \@if at footnotes@TF
       {\@outputbox at append{\vfill}}%
       {\@if at bfloats@TF
@@ -557,7 +555,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareRCBCode{@makecol/outputbox}{floats-footnotes} {%
+\DeclareNamedBlockCode{@makecol/outputbox}{floats-footnotes} {%
   \@outputbox at attachfloats
   \@outputbox at appendfootnotes
   \@outputbox at reinsertbskip
@@ -565,7 +563,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\DeclareRCBCode{@makecol/outputbox}{footnotes-floats} {%
+\DeclareNamedBlockCode{@makecol/outputbox}{footnotes-floats} {%
   \@outputbox at appendfootnotes
   \@outputbox at attachfloats
 %    \end{macrocode}
@@ -581,9 +579,9 @@
 %    \end{macrocode}
 %    The \texttt{footnote-floats} one is is the default used by
 %    \LaTeX{}, it can be overwritten either through \pkg{footmisc} or
-%    by assigning any of the other named RCB code chunks.
+%    by assigning any of the other named block code chunks.
 %    \begin{macrocode}
-\AssignRCBCode{@makecol/outputbox}{footnotes-floats}
+\AssignNamedBlockCode{@makecol/outputbox}{footnotes-floats}
 %    \end{macrocode}
 %
 %
diff --git a/required/latex-lab/latex-lab-rcb.dtx b/required/latex-lab/latex-lab-rcb.dtx
index 76df28d2..ee7bc9d7 100644
--- a/required/latex-lab/latex-lab-rcb.dtx
+++ b/required/latex-lab/latex-lab-rcb.dtx
@@ -43,7 +43,8 @@
 %
 % \section{Introduction}
 %
-%    This code implements the \enquote{replaceable code blocks}.
+%    This code implements the \enquote{replaceable code blocks} or
+%    named blocks as we call them.
 %
 %
 %
@@ -53,9 +54,9 @@
 %
 % \section{The Implementation}
 %
-%    The implementation of the RCB mechanism should be redone and we
+%    The implementation of the named code block mechanism should be redone and we
 %    should probably stored the different code chunks in a property
-%    list so that we can have a decent \cs{ShowRCB} command the shows
+%    list so that we can have a decent \cs{ShowNamedBlock} command the shows
 %    the available alternatives.
 %
 %    \begin{macrocode}
@@ -74,23 +75,22 @@
 %
 %  \begin{macro}{\rcb_new:nn}
 %    
-%    Declaring a RCB creates a str to hold the name (a pointer) to the
-%    code that should be used when the RCB is used, and an integer to
-%    hold the number of arguments of that RCB.  Initially, an
-%    "unassigned" code chunk is created and assigned so the RCB cannot
-%    be used without a proper code block being assigned.
+%    Declaring a named block creates a str to hold the name (a pointer) to the
+%    code that should be used when the named block is used, and an integer to
+%    hold the number of arguments of that named block.  Initially, an
+%    ``empty'' code chunk is created and assigned so the named block
+%    does nothing by default other than swallowing its arguments (if any).
 %    \begin{macrocode}
 \cs_new_protected:Npn \rcb_new:nn #1 #2 {
   \str_if_exist:cTF { g_@@_#1_code_str }
       {
-        \errmessage { RCB~ '#1'~ already~ declared! }
+        \errmessage { Named~ block~ '#1'~ already~ declared! }
       }
       {
         \str_new:c { g_@@_#1_code_str }
         \int_const:cn { c_@@_#1_args_int } {#2}
-        \rcb_new_code:nnn {#1} { _@@_unassigned }
-                          { \errmessage { No~RCB~code~for~'#1'~assigned! } }
-        \rcb_assign_code:nn {#1} { _@@_unassigned }
+        \rcb_new_code:nnn {#1} { do_nothing } { }
+        \rcb_assign_code:nn {#1} { do_nothing }
       }
 }
 %    \end{macrocode}
@@ -100,7 +100,7 @@
 %  
 %  \begin{macro}{\rcb_new_code:nnn}
 %    
-%    Declaring a code for an RCB is just doing a definition, taking
+%    Declaring a code for a named block is just making a definition, taking
 %    the number of arguments from the saved int.
 %    \begin{macrocode}
 \cs_new_protected:Npn \rcb_new_code:nnn #1 #2 #3 {
@@ -113,7 +113,7 @@
            {#3}
       }
       {
-        \errmessage { RCB~ '#1'~ not~ declared! }
+        \errmessage { Named~ block~ '#1'~ not~ declared! }
       }
 }
 %    \end{macrocode}
@@ -123,7 +123,8 @@
 %  
 %  \begin{macro}{\rcb_assign_code:nn}
 %    
-%    Assigning a RCB just changes the name in the RCB string.
+%    Assigning stored code to a named block just changes the name in
+%    the RCB string.
 %    \begin{macrocode}
 \cs_new_protected:Npn \rcb_assign_code:nn #1 #2 {
   \str_if_exist:cTF { g_@@_#1_code_str }
@@ -133,11 +134,11 @@
             \str_gset:cn { g_@@_#1_code_str } {#2}
           }
           {
-            \errmessage { RCB~ instance~ '#2'~ for~ RCB~ '#1'~ not~ declared! }
+            \errmessage { Named~ block~ instance~ '#2'~ for~ the~ block~ '#1'~ not~ declared! }
           }
       }
       {
-        \errmessage { RCB~ '#1'~ not~ declared! }
+        \errmessage { Named~ block~ '#1'~ not~ declared! }
       }
 }
 %    \end{macrocode}
@@ -157,13 +158,14 @@
 %  
 % \subsection{The \LaTeXe{} interface commands}
 %
-%  \begin{macro}{\NewRCB,\DeclareRCBCode,\AssignRCBCode,\UseRCB}
+%  \begin{macro}{\NewNamedBlock,\DeclareNamedBlockCode,
+%                \AssignNamedBlockCode,\UseNamedBlock}
 %    
 %    \begin{macrocode}
-\cs_new_eq:NN \NewRCB         \rcb_new:nn 
-\cs_new_eq:NN \DeclareRCBCode \rcb_new_code:nnn
-\cs_new_eq:NN \AssignRCBCode  \rcb_assign_code:nn
-\cs_new_eq:NN \UseRCB         \rcb_use:n
+\cs_new_eq:NN \NewNamedBlock         \rcb_new:nn 
+\cs_new_eq:NN \DeclareNamedBlockCode \rcb_new_code:nnn
+\cs_new_eq:NN \AssignNamedBlockCode  \rcb_assign_code:nn
+\cs_new_eq:NN \UseNamedBlock         \rcb_use:n
 %    \end{macrocode}
 %  \end{macro}
 %  





More information about the latex3-commits mailing list.