[latex3-commits] [git/LaTeX3-latex3-latex3] master: Instead of defining \color as a no-op when undefined, use a wrapper (f4ce52b)

Bruno Le Floch bruno at le-floch.fr
Sat Mar 2 14:17:10 CET 2019


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

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

commit f4ce52be3d3eda19f115008112a50ae2df012352
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Sat Mar 2 14:17:10 2019 +0100

    Instead of defining \color as a no-op when undefined, use a wrapper


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

f4ce52be3d3eda19f115008112a50ae2df012352
 l3kernel/CHANGELOG.md                   |    1 +
 l3kernel/expl3.dtx                      |   12 ------------
 l3kernel/l3coffins.dtx                  |   16 ++++++++++++----
 l3kernel/testfiles/m3expl001.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl001.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl001.tlg        |    1 +
 l3kernel/testfiles/m3expl001.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl001.xetex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl003.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl003.tlg        |    1 +
 l3kernel/testfiles/m3expl003.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.xetex.tlg  |    1 +
 13 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 6a8b478..1cfe6c0 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -25,6 +25,7 @@ this project uses date-based 'snapshot' version identifiers.
   `\cs_argument_spec:N`, `\cs_replacement_spec:N`, respectively
 - Made expandable messages expand their result, like usual messages
 - Made deprecation errors less intrusive by default
+- Stopped providing do-nothing \color macro when undefined
 
 ### Removed
 
diff --git a/l3kernel/expl3.dtx b/l3kernel/expl3.dtx
index d2dce92..72061ef 100644
--- a/l3kernel/expl3.dtx
+++ b/l3kernel/expl3.dtx
@@ -1287,18 +1287,6 @@
 \fi
 %    \end{macrocode}
 %
-% \begin{macro}{\color}
-%   The \cs{color} macro must be defined for showing coffin poles, so
-%   a no-op version is provided here.
-%    \begin{macrocode}
-\AtBeginDocument
-  {
-    \cs_if_exist:NF \color
-      { \DeclareRobustCommand \color [2] [ ] { } }
-  }
-%    \end{macrocode}
-% \end{macro}
-%
 % \begin{variable}{\l__expl_driver_tl}
 % \begin{variable}{\l__expl_native_drivers_bool}
 %   With the code now loaded, options can be handled using a real key--value
diff --git a/l3kernel/l3coffins.dtx b/l3kernel/l3coffins.dtx
index 09d17de..6bf6a0e 100644
--- a/l3kernel/l3coffins.dtx
+++ b/l3kernel/l3coffins.dtx
@@ -2270,6 +2270,14 @@
 %    \end{macrocode}
 % \end{variable}
 %
+% \begin{macro}{\@@_color:n}
+%   Calls \tn{color}, and otherwise does nothing if \tn{color} is not defined.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_color:n #1
+  { \cs_if_exist:NT \color { \color {#1} } }
+%    \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
@@ -2286,7 +2294,7 @@
         \hbox:n { \tex_vrule:D width 1pt height 1pt \scan_stop: } % TODO
 %</initex>
 %<*package>
-        \color {#4}
+        \@@_color:n {#4}
         \rule { 1pt } { 1pt }
 %</package>
       }
@@ -2298,7 +2306,7 @@
         % TODO
 %</initex>
 %<*package>
-        \color {#4}
+        \@@_color:n {#4}
 %</package>
         \l_@@_display_font_tl
         ( \tl_to_str:n { #2 , #3 } )
@@ -2355,7 +2363,7 @@
         \hbox:n { \tex_vrule:D width 1pt height 1pt \scan_stop: } % TODO
 %</initex>
 %<*package>
-        \color {#2}
+        \@@_color:n {#2}
         \rule { 1pt } { 1pt }
 %</package>
       }
@@ -2401,7 +2409,7 @@
                 % TODO
 %</initex>
 %<*package>
-                \color {#6}
+                \@@_color:n {#6}
 %</package>
                 \l_@@_display_font_tl
                 ( \tl_to_str:n { #1 , ##1 } )
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index afd1d7b..0100c59 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5509,6 +5509,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index c5a6973..04911ae 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5809,6 +5809,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index bc87d7a..3ad4f85 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5809,6 +5809,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index e5ff6ff..fa374d0 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5806,6 +5806,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 4adcc90..fe650c2 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5524,6 +5524,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index afd1d7b..0100c59 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5509,6 +5509,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index c5a6973..04911ae 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5809,6 +5809,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index bc87d7a..3ad4f85 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5809,6 +5809,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index e5ff6ff..fa374d0 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5806,6 +5806,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 4adcc90..fe650c2 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5524,6 +5524,7 @@ Defining \l__coffin_display_y_dim on line ...
 \l__coffin_display_y_dim=\dimen...
 Defining \l__coffin_display_poles_prop on line ...
 Defining \l__coffin_display_font_tl on line ...
+Defining \__coffin_color:n on line ...
 Defining \coffin_mark_handle:Nnnn on line ...
 Defining \__coffin_mark_handle_aux:nnnnNnn on line ...
 Defining \coffin_mark_handle:cnnn on line ...





More information about the latex3-commits mailing list