[latex3-commits] [git/LaTeX3-latex3-latex3] main: Tighten approach to "current" color (dd153c8ac)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Jan 6 20:09:22 CET 2022


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/dd153c8acdac378147756561120b4f4d730d5782

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

commit dd153c8acdac378147756561120b4f4d730d5782
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Jan 6 19:09:22 2022 +0000

    Tighten approach to "current" color


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

dd153c8acdac378147756561120b4f4d730d5782
 l3kernel/l3color.dtx | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/l3kernel/l3color.dtx b/l3kernel/l3color.dtx
index f77304a0a..359b6792c 100644
--- a/l3kernel/l3color.dtx
+++ b/l3kernel/l3color.dtx
@@ -249,6 +249,9 @@
 % General selection of color is safe when split across pages: a stack is
 % used to ensure that the correct color is re-selected on the new page.
 %
+% These commands set the current color (|.|): other more specialised functions
+% such as fill and stroke selectors do \emph{not} adjust this value.
+%
 % \begin{function}{\color_select:n}
 %   \begin{syntax}
 %     \cs{color_select:n} \Arg{color expression}
@@ -281,9 +284,6 @@
 % support this, and so color will need to be contained within a scope, such
 % as \cs{draw_begin:}/\cs{draw_end:}.
 %
-% Note that the \emph{current color} is the fill color, as this is used for
-% running text.
-%
 % \begin{function}{\color_fill:n, \color_stroke:n}
 %   \begin{syntax}
 %     \cs{color_fill:n} \Arg{color expression}
@@ -1222,13 +1222,13 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\@@_select:}
+% \begin{macro}{\@@_finalise_current:}
 %   A backend-neutral location for \enquote{last minute} manipulations before
 %   handing off to the backend code.  We set the special |.| syntax here: this
 %   will therefore always be available. The finalisation is separate from the
 %   main function so it can also be applied to \emph{e.g.}~page color.
 %    \begin{macrocode}
-\cs_new_protected:Npx \@@_select:
+\cs_new_protected:Npx \@@_finalise_current:
   {
     \tl_set:Nx \exp_not:c { l_@@_named_ . _tl }
       { \exp_not:N \@@_model:N \exp_not:N \l_@@_current_tl }
@@ -1236,7 +1236,6 @@
     \prop_put:NVx \exp_not:c { l_@@_named_ . _prop }
       \exp_not:c { l_@@_named_ . _tl }
       { \exp_not:N \@@_values:N \exp_not:N \l_@@_current_tl }
-    \@@_select:N \exp_not:N \l_@@_current_tl
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1254,13 +1253,15 @@
 \cs_new_protected:Npn \color_select:n #1
   {
     \@@_parse:nN {#1} \l_@@_current_tl
-    \@@_select:
+    \@@_finalise_current:
+    \@@_select:N \l_@@_current_tl
   }
 \cs_new_protected:Npn \color_select:nn #1#2
   {
     \@@_select_main:Nw \l_@@_current_tl
       #1 / / \s_@@_mark #2 / / \s_@@_stop
-    \@@_select:
+    \@@_finalise_current:
+    \@@_select:N \l_@@_current_tl
   }
 %    \end{macrocode}
 %   If the first color model is the fixed one, or if there is no fixed





More information about the latex3-commits mailing list.