[latex3-commits] [git/LaTeX3-latex3-latex3] master: Save some repetition (6f40c27d4)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Dec 9 00:20:15 CET 2020


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

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

commit 6f40c27d4f82aa5813d67c45b08b18de0ca9c6eb
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Dec 8 23:20:15 2020 +0000

    Save some repetition


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

6f40c27d4f82aa5813d67c45b08b18de0ca9c6eb
 l3backend/l3backend-color.dtx | 58 ++++++++++++-------------------------------
 1 file changed, 16 insertions(+), 42 deletions(-)

diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index 59dca8eff..5ada50a70 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -239,10 +239,10 @@
 %</dvipdfmx|xetex>
 %    \end{macrocode}
 %
-% \subsubsection{\LuaTeX}
+% \subsubsection{\LuaTeX and \pdfTeX{}}
 %
 %    \begin{macrocode}
-%<*luatex>
+%<*luatex|pdftex>
 %    \end{macrocode}
 %
 % \begin{macro}{\__kernel_color_stack_init:Nnn}
@@ -251,8 +251,13 @@
   {
     \int_set:Nn #1
       {
+%<*luatex>
         \tex_pdfextension:D colorstackinit ~
-        \tl_if_blank:nF {#2} { ~ #2 }
+%</luatex>
+%<*pdftex>
+        \tex_pdfcolorstackinit
+%</pdftex>
+        \tl_if_blank:nF {#2} { #2 ~ }
         {#3}
       }
   }
@@ -264,53 +269,22 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \__kernel_color_stack_push:nn #1#2
   {
+%<*luatex>
     \tex_pdfextension:D colorstack ~
-      \int_eval:n {#1} ~ push ~ {#2}
-  }
-\cs_new_protected:Npn \__kernel_color_stack_pop:n #1
-  {
-    \tex_pdfextension:D colorstack ~
-      \int_eval:n {#1} ~ pop \scan_stop:
-  }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%    \begin{macrocode}
 %</luatex>
-%    \end{macrocode}
-%
-% \subsubsection{\pdfTeX}
-%
-%    \begin{macrocode}
 %<*pdftex>
-%    \end{macrocode}
-%
-% \begin{macro}{\__kernel_color_stack_init:Nnn}
-%    \begin{macrocode}
-\cs_new_protected:Npn \__kernel_color_stack_init:Nnn #1#2#3
-  {
-    \int_set:Nn #1
-      {
-        \tex_pdfcolorstackinit ~
-        \tl_if_blank:nF {#2} { ~ #2 }
-        {#3}
-      }
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\__kernel_color_stack_push:nn}
-% \begin{macro}{\__kernel_color_stack_pop:n}
-%    \begin{macrocode}
-\cs_new_protected:Npn \__kernel_color_stack_push:nn #1#2
-  {
     \tex_pdfcolorstack:D
+%</pdftex>
       \int_eval:n {#1} ~ push ~ {#2}
   }
 \cs_new_protected:Npn \__kernel_color_stack_pop:n #1
   {
+%<*luatex>
+    \tex_pdfextension:D colorstack ~
+%</luatex>
+%<*pdftex>
     \tex_pdfcolorstack:D
+%</pdftex>
       \int_eval:n {#1} ~ pop \scan_stop:
   }
 %    \end{macrocode}
@@ -318,7 +292,7 @@
 % \end{macro}
 %
 %    \begin{macrocode}
-%</pdftex>
+%</luatex|pdftex>
 %    \end{macrocode}
 %
 % \subsection{General color}





More information about the latex3-commits mailing list.