[latex3-commits] [git/LaTeX3-latex3-latex2e] master: fix for #41 (202c157)

Frank Mittelbach frank.mittelbach at latex-project.org
Wed Sep 26 00:24:05 CEST 2018


Repository : https://github.com/latex3/latex2e
On branch  : master
Link       : https://github.com/latex3/latex2e/commit/202c1579ad104df10738507269f4fd579ffa0556

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

commit 202c1579ad104df10738507269f4fd579ffa0556
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Wed Sep 26 00:24:05 2018 +0200

    fix for #41


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

202c1579ad104df10738507269f4fd579ffa0556
 base/changes.txt            |    6 ++++
 base/ltdefns.dtx            |    8 +++--
 base/testfiles/git-0041.lvt |   25 +++++++++++++++
 base/testfiles/git-0041.tlg |   75 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 111 insertions(+), 3 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index 2a7274e..77dd3dc 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -4,6 +4,12 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 =======================================================================
 
+2018-09-26  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltdefns.dtx (subsection{Command definitions}):
+	In the error messages always explicitly generate a space
+	after the csname and not rely on \noexpand to save tokens (git/41)
+
 2018-09-25  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
 
 	* doc.dtx (section*{Index}):
diff --git a/base/ltdefns.dtx b/base/ltdefns.dtx
index 6c6e691..3a7d6f0 100644
--- a/base/ltdefns.dtx
+++ b/base/ltdefns.dtx
@@ -32,7 +32,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltdefns.dtx}
-             [2018/01/08 v1.5d LaTeX Kernel (definition commands)]
+             [2018/09/26 v1.5e LaTeX Kernel (definition commands)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltdefns.dtx}
@@ -527,7 +527,7 @@
 % two csnames per command, the price is the extra expansion time
 % for the |\ifx| test.
 %    \begin{macrocode}
-\def\@protected at testopt#1{%%
+\def\@protected at testopt#1{%
   \ifx\protect\@typeset at protect
     \expandafter\@testopt
   \else
@@ -624,11 +624,13 @@
 %  \changes{v1.2y}{1996/07/26}{use \cs{noexpand} instead of \cs{string}}
 % \changes{v1.2z1}{1997/10/21}{Use \cs{begingroup}/\cs{endgroup} rather
 %    than braces for grouping, to avoid generating empty math atom.}
+% \changes{v1.5e}{2018/09/26}{Always explicitly generate a space after the csname and
+%    not rely on \cs{noexpand} to save tokens (git/41)}
 %    \begin{macrocode}
 \def\renew at command#1{%
   \begingroup \escapechar\m at ne\xdef\@gtempa{{\string#1}}\endgroup
   \expandafter\@ifundefined\@gtempa
-     {\@latex at error{\noexpand#1undefined}\@ehc}%
+     {\@latex at error{Command \string#1 undefined}\@ehc}%
      \relax
   \let\@ifdefinable\@rc at ifdefinable
   \new at command#1}
diff --git a/base/testfiles/git-0041.lvt b/base/testfiles/git-0041.lvt
new file mode 100644
index 0000000..cce3c5a
--- /dev/null
+++ b/base/testfiles/git-0041.lvt
@@ -0,0 +1,25 @@
+\documentclass{article}
+
+
+\input{test2e}
+
+\START
+
+\newcommand\${}
+\newcommand\$[3][default]{}
+
+\renewcommand\1{}  % this defines it!
+
+\show\1
+
+\newcommand\1[2]{}
+
+
+\newcommand\bar{}
+\newcommand\bar[1][default]{}
+
+\renewcommand\foo{}
+\newcommand\foo[9]{}
+
+ 
+\END
diff --git a/base/testfiles/git-0041.tlg b/base/testfiles/git-0041.tlg
new file mode 100644
index 0000000..7deba22
--- /dev/null
+++ b/base/testfiles/git-0041.tlg
@@ -0,0 +1,75 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+! LaTeX Error: Command \$ already defined.
+               Or name \end... illegal, see p.192 of the manual.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\newcommand\${}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+! LaTeX Error: Command \$ already defined.
+               Or name \end... illegal, see p.192 of the manual.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\newcommand\$[3][default]{}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+! LaTeX Error: Command \1 undefined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\renewcommand\1
+                    {}  % this defines it!
+Try typing  <return>  to proceed.
+If that doesn't work, type  X <return>  to quit.
+> \1=\long macro:
+->.
+l. ...\show\1
+! LaTeX Error: Command \1 already defined.
+               Or name \end... illegal, see p.192 of the manual.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\newcommand\1[2]{}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+! LaTeX Error: Command \bar already defined.
+               Or name \end... illegal, see p.192 of the manual.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\newcommand\bar{}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+! LaTeX Error: Command \bar already defined.
+               Or name \end... illegal, see p.192 of the manual.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\newcommand\bar[1][default]{}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.
+! LaTeX Error: Command \foo undefined.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\renewcommand\foo
+                      {}
+Try typing  <return>  to proceed.
+If that doesn't work, type  X <return>  to quit.
+! LaTeX Error: Command \foo already defined.
+               Or name \end... illegal, see p.192 of the manual.
+See the LaTeX manual or LaTeX Companion for explanation.
+Type  H <return>  for immediate help.
+ ...                                              
+l. ...\newcommand\foo[9]{}
+Your command was ignored.
+Type  I <command> <return>  to replace it with another command,
+or  <return>  to continue without it.





More information about the latex3-commits mailing list