[latex3-commits] [git/LaTeX3-latex3-latex2e] gh659: updates for issue #659 (e35d5548)

David Carlisle d.p.carlisle at gmail.com
Mon Sep 27 18:55:54 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh659
Link       : https://github.com/latex3/latex2e/commit/e35d5548c29daa33bdcc566a6abc5bf03d7df9bd

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

commit e35d5548c29daa33bdcc566a6abc5bf03d7df9bd
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Mon Sep 27 17:55:54 2021 +0100

    updates for issue #659


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

e35d5548c29daa33bdcc566a6abc5bf03d7df9bd
 required/graphics/changes.txt                           |  6 ++++++
 required/graphics/color.dtx                             | 17 ++++++++++-------
 required/graphics/testfiles/github-0659.lvt             | 16 ++++++++++++++++
 .../graphics/testfiles/github-0659.tlg                  |  0
 4 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/required/graphics/changes.txt b/required/graphics/changes.txt
index bd328646..c74d3abd 100644
--- a/required/graphics/changes.txt
+++ b/required/graphics/changes.txt
@@ -4,6 +4,12 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2021-09-27  David Carlisle  <David.Carlisle at latex-project.org>
+
+	* color.dtx: use \@backslashchar color rather than \string\color to
+	generate internal csnames, to avoid relying on the current setting
+	of \escapechar
+
 2021-09-16  David Carlisle  <David.Carlisle at latex-project.org>
 
 	* graphicx.dtx: Add an alt key to \includegraphics gh/651
diff --git a/required/graphics/color.dtx b/required/graphics/color.dtx
index 2dfbb238..f27dfe48 100644
--- a/required/graphics/color.dtx
+++ b/required/graphics/color.dtx
@@ -21,7 +21,7 @@
 %<driver> \ProvidesFile{color.drv}
 % \fi
 %         \ProvidesFile{color.dtx}
-          [2020/02/24 v1.2b Standard LaTeX Color (DPC)]
+          [2021/09/27 v1.3a Standard LaTeX Color (DPC)]
 %
 % \iffalse
 %<*driver>
@@ -78,6 +78,9 @@
 % fixed values whilst this file is being read.
 % \changes{v0.3b}{1994/09/14}
 %     {Save and restore catcodes}
+% \changes{v1.3a}{2021/09/27}
+%     {Use \cs{@backslashchar} in preference to \cs{string} gh/659}
+%
 %    \begin{macrocode}
 \edef\Gin at codes{%
  \catcode`\noexpand\^^A\the\catcode`\^^A\relax
@@ -375,7 +378,7 @@
 %    \begin{macrocode}
 \DeclareOption{usenames}{%
   \def\c at lor@usename#1{%
-    \expandafter\color at named\csname\string\color @#1\endcsname{#1}}}
+    \expandafter\color at named\csname\@backslashchar color @#1\endcsname{#1}}}
 %    \end{macrocode}
 % \end{option}
 %
@@ -432,10 +435,10 @@
 % Finally call |\set at color| to effect the colour change.
 %    \begin{macrocode}
 \def\@declaredcolor#1{%
-  \@ifundefined{\string\color @#1}%
+  \@ifundefined{\@backslashchar color @#1}%
     {\c at lor@error{`#1'}}%
     {\expandafter\let\expandafter\current at color
-     \csname\string\color @#1\endcsname
+     \csname\@backslashchar color @#1\endcsname
      \set at color}%
   \ignorespaces}
 %    \end{macrocode}
@@ -506,7 +509,7 @@
 %    \begin{macrocode}
 \protected\def\nopagecolor{%
   \@ifundefined{no at page@color}{%
-    \PackageInfo{color}{\string\nopagecolor\space is not supported}%
+    \PackageInfo{color}{\@backslashchar nopagecolor\space is not supported}%
   }{%
     \no at page@color
   }%
@@ -545,10 +548,10 @@
 \protected\def\definecolor#1#2#3{%
   \@ifundefined{color@#2}%
     {\c at lor@error{model `#2'}}%
-    {\@ifundefined{\string\color @#1}{}%
+    {\@ifundefined{\@backslashchar color @#1}{}%
       {\PackageInfo{color}{Redefining color #1}}%
      \csname color@#2\expandafter\endcsname
-         \csname\string\color @#1\endcsname{#3}}}
+         \csname\@backslashchar color @#1\endcsname{#3}}}
 %    \end{macrocode}
 %  \end{macro}
 %
diff --git a/required/graphics/testfiles/github-0659.lvt b/required/graphics/testfiles/github-0659.lvt
new file mode 100644
index 00000000..2f9a5db3
--- /dev/null
+++ b/required/graphics/testfiles/github-0659.lvt
@@ -0,0 +1,16 @@
+\documentclass{article}
+
+\usepackage{color}
+\input{test2e}
+
+\begin{document}
+
+\color{blue} blue
+
+\escapechar=-1
+
+\START
+% should not generate an error
+\color{blue} blue
+
+\END
\ No newline at end of file
diff --git a/base/testfiles/github-0060.luatex.tlg b/required/graphics/testfiles/github-0659.tlg
similarity index 100%
copy from base/testfiles/github-0060.luatex.tlg
copy to required/graphics/testfiles/github-0659.tlg





More information about the latex3-commits mailing list.