[latex3-commits] [git/LaTeX3-latex3-latex3] master: Drop IniTeX guards in l3coffins (see #776) (474ff38aa)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Jul 20 12:34:25 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/474ff38aad2d8ea619ff2d643fe501295badb98a

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

commit 474ff38aad2d8ea619ff2d643fe501295badb98a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Jul 20 11:34:25 2020 +0100

    Drop IniTeX guards in l3coffins (see #776)
    
    This results in some clearer internal abstractions,
    which hopefully will be resolved over the coming months.


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

474ff38aad2d8ea619ff2d643fe501295badb98a
 l3kernel/l3coffins.dtx | 57 ++++++++++++++++++++++++++------------------------
 1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/l3kernel/l3coffins.dtx b/l3kernel/l3coffins.dtx
index 46edd8d99..3170d6582 100644
--- a/l3kernel/l3coffins.dtx
+++ b/l3kernel/l3coffins.dtx
@@ -667,6 +667,7 @@
 %     \vcoffin_gset:Nnn, \vcoffin_gset:cnn
 %   }
 %  \begin{macro}{\@@_set_vertical:NnnNN}
+%  \begin{macro}{\@@_set_vertical_aux:}
 %   Setting vertical coffins is more complex. First, the material is
 %   typeset with a given width. The default handles and poles are set as
 %   for a horizontal coffin, before finding the top baseline using a
@@ -694,10 +695,7 @@
         #4 #1
           {
             \dim_set:Nn \tex_hsize:D {#2}
-%<*package>
-            \dim_set_eq:NN \linewidth   \tex_hsize:D
-            \dim_set_eq:NN \columnwidth \tex_hsize:D
-%</package>
+            \@@_set_vertical_aux:
             #3
           }
         #5 #1
@@ -715,9 +713,17 @@
         \box_clear:N \l_@@_internal_box
       }
   }
+\cs_new_protected:Npx \@@_set_vertical_aux:
+  {
+    \cs_if_exist:NT \linewidth
+      { \dim_set_eq:NN \linewidth \tex_hsize:D }
+    \cs_if_exist:NT \columnwidth
+      { \dim_set_eq:NN \columnwidth \tex_hsize:D }
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 % \begin{macro}
 %   {\hcoffin_set:Nw, \hcoffin_set:cw, \hcoffin_gset:Nw, \hcoffin_gset:cw}
@@ -783,10 +789,7 @@
       {
         #3 #1
           \dim_set:Nn \tex_hsize:D {#2}
-%<*package>
-            \dim_set_eq:NN \linewidth   \tex_hsize:D
-            \dim_set_eq:NN \columnwidth \tex_hsize:D
-%</package>
+          \@@_set_vertical_aux:
           \cs_set_protected:Npn #4
             {
               #5
@@ -2233,9 +2236,11 @@
 %   flexible.
 %    \begin{macrocode}
 \tl_new:N  \l_@@_display_font_tl
-%<*package>
-\tl_set:Nn \l_@@_display_font_tl { \sffamily \tiny }
-%</package>
+\tl_set:Nx \l_@@_display_font_tl
+  {
+    \cs_if_exist:NT \sffamily { \exp_not:N \sffamily }
+    \cs_if_exist:NT \tiny { \exp_not:N \tiny }
+  }
 %    \end{macrocode}
 % \end{variable}
 %
@@ -2259,6 +2264,18 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_rule:nn}
+%   Abstract out creation of rules here until there is a higher-level interface.
+%    \begin{macrocode}
+\cs_new_protected:Npx \@@_rule:nn #1#2
+  {
+    \cs_if_exist:NTF \rule
+      { \exp_not:N \rule {#1} {#2} }
+      { \hbox:n { \tex_rule:D width #1 height #2 \scan_stop: } }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\coffin_mark_handle:Nnnn, \coffin_mark_handle:cnnn}
 % \begin{macro}{\@@_mark_handle_aux:nnnnNnn}
 %   Marking a single handle is relatively easy. The standard attachment
@@ -2271,21 +2288,14 @@
   {
     \hcoffin_set:Nn \l_@@_display_pole_coffin
       {
-%<*initex>
-        \hbox:n { \tex_vrule:D width 1pt height 1pt \scan_stop: }
-%</initex>
-%<*package>
         \@@_color:n {#4}
-        \rule { 1pt } { 1pt }
-%</package>
+        \@@_rule:nn { 1pt } { 1pt }
       }
     \@@_attach_mark:NnnNnnnn #1 {#2} {#3}
       \l_@@_display_pole_coffin { hc } { vc } { 0pt } { 0pt }
     \hcoffin_set:Nn \l_@@_display_coord_coffin
       {
-%<*package>
         \@@_color:n {#4}
-%</package>
         \l_@@_display_font_tl
         ( \tl_to_str:n { #2 , #3 } )
       }
@@ -2337,13 +2347,8 @@
   {
     \hcoffin_set:Nn \l_@@_display_pole_coffin
       {
-%<*initex>
-        \hbox:n { \tex_vrule:D width 1pt height 1pt \scan_stop: }
-%</initex>
-%<*package>
         \@@_color:n {#2}
-        \rule { 1pt } { 1pt }
-%</package>
+        \@@_rule:nn { 1pt } { 1pt }
       }
     \prop_set_eq:Nc \l_@@_display_poles_prop
       { coffin ~ \@@_to_value:N #1 ~ poles }
@@ -2383,9 +2388,7 @@
               { 0pt } { 0pt }
             \hcoffin_set:Nn \l_@@_display_coord_coffin
               {
-%<*package>
                 \@@_color:n {#6}
-%</package>
                 \l_@@_display_font_tl
                 ( \tl_to_str:n { #1 , ##1 } )
               }





More information about the latex3-commits mailing list.