[latex3-commits] [git/LaTeX3-latex3-latex2e] TL21-2-kernel-msgs: improve message; more tests (7a1785f2)

Frank Mittelbach frank.mittelbach at latex-project.org
Mon Jun 7 13:14:43 CEST 2021


Repository : https://github.com/latex3/latex2e
On branch  : TL21-2-kernel-msgs
Link       : https://github.com/latex3/latex2e/commit/7a1785f2c54bfe9353490adef1de12b5c9b894cf

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

commit 7a1785f2c54bfe9353490adef1de12b5c9b894cf
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Mon Jun 7 13:14:43 2021 +0200

    improve message; more tests


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

7a1785f2c54bfe9353490adef1de12b5c9b894cf
 base/ltcmd.dtx                           |  9 ++++---
 base/testfiles-ltcmd/ltcmd004.luatex.tlg | 42 ++++++++++++++++----------------
 base/testfiles-ltcmd/ltcmd004.tlg        | 42 ++++++++++++++++----------------
 base/testfiles-ltcmd/ltcmd007.lvt        |  3 +++
 base/testfiles-ltcmd/ltcmd007.tlg        | 20 +++++++++++++--
 5 files changed, 68 insertions(+), 48 deletions(-)

diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 81a359a5..e10f85c0 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -3755,12 +3755,13 @@
   {
     Optional~and~mandatory~argument~with~same~delimiter~'#2'.
     \\ \\
-    The~mandatory~argument~specified~with~'r'~or~'R'~has~the~
+    The~mandatory~argument~specified~with~
+    '\str_case:nnF{#1}{ {R/r}{r'~or~'R} }{#1}'~has~the~
     same~delimiter~'#2'~as~an~earlier~optional~argument.~
-    It~will~therefore~not~be~possible~to~
-    omit~all~the~optional~arguments~when~calling~this~command.
+    It~will~therefore~not~be~possible~to~omit~all~the~earlier~
+    optional~arguments~when~calling~this~command.
     \\ \\
-    This~may~be~intentional,~but~then~it~my~be~a~mistake.
+    This~may~be~intentional,~but~then~it~might~be~a~mistake.
   }
 \msg_new:nnn { cmd } { unsupported-let }
   {
diff --git a/base/testfiles-ltcmd/ltcmd004.luatex.tlg b/base/testfiles-ltcmd/ltcmd004.luatex.tlg
index 25ffa599..d55155bb 100644
--- a/base/testfiles-ltcmd/ltcmd004.luatex.tlg
+++ b/base/testfiles-ltcmd/ltcmd004.luatex.tlg
@@ -634,73 +634,73 @@ LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '[' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a|b|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '[' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a|b|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter ':'.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter ':' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a:b,c|d|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter ':'.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter ':' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a:b,c|d|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '[' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |-NoValue-|\BooleanTrue |a|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '*'.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '*' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |\BooleanTrue |a|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '('.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '(' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |\BooleanTrue |a(b)c|\BooleanTrue |
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '_'.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '_' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |{_}{a}|\BooleanFalse ||
 |{a}{-NoValue-}|\BooleanFalse |abc|
 |{-NoValue-}{-NoValue-}|\BooleanTrue |a|
@@ -743,10 +743,10 @@ LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '[' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a|b|
 |a|b|
 ============================================================
@@ -820,10 +820,10 @@ LaTeX cmd Warning: Optional and mandatory argument with same delimiter '\('.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '\(' as an earlier optional argument. It
-(cmd)              will therefore not be possible to omit all the optional
-(cmd)              arguments when calling this command.
+(cmd)              will therefore not be possible to omit all the earlier
+(cmd)              optional arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 abc/def
 abc/def
 abc/-NoValue-
diff --git a/base/testfiles-ltcmd/ltcmd004.tlg b/base/testfiles-ltcmd/ltcmd004.tlg
index 62753a3d..2b0f1654 100644
--- a/base/testfiles-ltcmd/ltcmd004.tlg
+++ b/base/testfiles-ltcmd/ltcmd004.tlg
@@ -634,73 +634,73 @@ LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '[' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a|b|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '[' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a|b|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter ':'.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter ':' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a:b,c|d|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter ':'.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter ':' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a:b,c|d|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '[' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |-NoValue-|\BooleanTrue |a|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '*'.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '*' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |\BooleanTrue |a|
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '('.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '(' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |\BooleanTrue |a(b)c|\BooleanTrue |
 LaTeX cmd Warning: Optional and mandatory argument with same delimiter '_'.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '_' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |{_}{a}|\BooleanFalse ||
 |{a}{-NoValue-}|\BooleanFalse |abc|
 |{-NoValue-}{-NoValue-}|\BooleanTrue |a|
@@ -743,10 +743,10 @@ LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '[' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 |a|b|
 |a|b|
 ============================================================
@@ -820,10 +820,10 @@ LaTeX cmd Warning: Optional and mandatory argument with same delimiter '\('.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '\(' as an earlier optional argument. It
-(cmd)              will therefore not be possible to omit all the optional
-(cmd)              arguments when calling this command.
+(cmd)              will therefore not be possible to omit all the earlier
+(cmd)              optional arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 abc/def
 abc/def
 abc/-NoValue-
diff --git a/base/testfiles-ltcmd/ltcmd007.lvt b/base/testfiles-ltcmd/ltcmd007.lvt
index 8de88a8b..ff18ff68 100644
--- a/base/testfiles-ltcmd/ltcmd007.lvt
+++ b/base/testfiles-ltcmd/ltcmd007.lvt
@@ -38,6 +38,9 @@
 
 \TEST { deprecated~ stuff }
   {
+    \NewDocumentCommand{\foo}{gm}{\typeout{|#1|#2|}}       % more of the previous
+    \RenewDocumentCommand{\foo}{G{?}m}{\typeout{|#1|#2|}}  % more of the previous
+%    
     \NewExpandableDocumentCommand\dummy{ol}{}
   }
 
diff --git a/base/testfiles-ltcmd/ltcmd007.tlg b/base/testfiles-ltcmd/ltcmd007.tlg
index 0c384699..69ad09da 100644
--- a/base/testfiles-ltcmd/ltcmd007.tlg
+++ b/base/testfiles-ltcmd/ltcmd007.tlg
@@ -35,10 +35,10 @@ LaTeX cmd Warning: Optional and mandatory argument with same delimiter '['.
 (cmd)              
 (cmd)              The mandatory argument specified with 'r' or 'R' has the
 (cmd)              same delimiter '[' as an earlier optional argument. It will
-(cmd)              therefore not be possible to omit all the optional
+(cmd)              therefore not be possible to omit all the earlier optional
 (cmd)              arguments when calling this command.
 (cmd)              
-(cmd)              This may be intentional, but then it my be a mistake.
+(cmd)              This may be intentional, but then it might be a mistake.
 ! LaTeX cmd Error: Required argument missing for command '\foo'.
 For immediate help type H <return>.
  ...                                              
@@ -53,6 +53,22 @@ not find this argument and will insert a default value for further processing.
 ============================================================
 TEST 3: deprecated stuff
 ============================================================
+LaTeX cmd Warning: Optional and mandatory argument with same delimiter '{'.
+(cmd)              
+(cmd)              The mandatory argument specified with 'm' has the same
+(cmd)              delimiter '{' as an earlier optional argument. It will
+(cmd)              therefore not be possible to omit all the earlier optional
+(cmd)              arguments when calling this command.
+(cmd)              
+(cmd)              This may be intentional, but then it might be a mistake.
+LaTeX cmd Warning: Optional and mandatory argument with same delimiter '{'.
+(cmd)              
+(cmd)              The mandatory argument specified with 'm' has the same
+(cmd)              delimiter '{' as an earlier optional argument. It will
+(cmd)              therefore not be possible to omit all the earlier optional
+(cmd)              arguments when calling this command.
+(cmd)              
+(cmd)              This may be intentional, but then it might be a mistake.
 ! Package xparse Error: Argument type 'l' not available after optional
 (xparse)                argument for expandable command '\dummy'.
 For immediate help type H <return>.





More information about the latex3-commits mailing list.