[latex3-commits] [git/LaTeX3-latex3-latex2e] gh712: Insert correct defaults in end-of-environment code (see #712) (1b4656a6)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Dec 2 08:14:32 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh712
Link       : https://github.com/latex3/latex2e/commit/1b4656a606a5385bfa190b192d1e80556b76316b

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

commit 1b4656a606a5385bfa190b192d1e80556b76316b
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Dec 2 07:14:32 2021 +0000

    Insert correct defaults in end-of-environment code (see #712)


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

1b4656a606a5385bfa190b192d1e80556b76316b
 base/changes.txt                                     |  6 ++++++
 base/ltcmd.dtx                                       | 12 ++++++++----
 base/testfiles/github-0712.lvt                       | 18 ++++++++++++++++++
 base/testfiles/{tlb-utf8-bom.tlg => github-0712.tlg} | 16 +++++++++-------
 4 files changed, 41 insertions(+), 11 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index de6cc373..7d70ff04 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,12 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2021-12-02 Joseph Wright <Joseph.Wright at latex-project.org>
+
+  * ltcmd.dtx
+  Insert correct default values for optional arguments into the end
+  of environments
+
 2021-11-17  Marcel Krüger  <Marcel.Krueger at latex-project.org>
 
 	* ltluatex.dtx:
diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 04be2abf..d2f184c3 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -34,8 +34,8 @@
 %%% From File: ltcmd.dtx
 %
 %    \begin{macrocode}
-\def\ltcmdversion{v1.0h}
-\def\ltcmddate{2021-08-30}
+\def\ltcmdversion{v1.0i}
+\def\ltcmddate{2021-12-02}
 %    \end{macrocode}
 %
 %<*driver>
@@ -626,6 +626,8 @@
 % \end{macro}
 %
 % \begin{macro}{\@@_start_aux:NNnnnn, \@@_start_aux:ccnnnn}
+% \changes{v1.0i}{2021/12/02}
+%    {Correct defaults for optional arguments in end-of-environment code (gh/712)}
 %   This sets up a few variables to minimize the boilerplate code
 %   included in all \pkg{xparse}-defined commands.  It then runs the
 %   grabbers~|#4|.  Again, the argument specification |#1| is only for
@@ -639,8 +641,6 @@
     \tl_set:Nn \l_@@_defaults_tl {#5}
     \tl_set:Nn \l_@@_process_all_tl {#6}
     #4
-    \bool_if:NT \l_@@_environment_bool
-      { \exp_args:No \@@_set_environment_end:n \l_@@_environment_str }
     \@@_run_code:
   }
 \cs_generate_variant:Nn \@@_start_aux:NNnnnn { cc }
@@ -648,6 +648,8 @@
 % \end{macro}
 %
 % \begin{macro}{\@@_run_code:}
+% \changes{v1.0i}{2021/12/02}
+%    {Correct defaults for optional arguments in end-of-environment code (gh/712)}
 %   After arguments are grabbed, this function is responsible for
 %   inserting default values, running processors, and finally doing
 %   \cs{group_align_safe_end:} as promised, and running the code.
@@ -656,6 +658,8 @@
   {
     \tl_if_empty:NF \l_@@_defaults_tl { \@@_defaults: }
     \tl_if_empty:NF \l_@@_process_all_tl { \@@_args_process: }
+    \bool_if:NT \l_@@_environment_bool
+      { \exp_args:No \@@_set_environment_end:n \l_@@_environment_str }
     \group_align_safe_end:
     \conditionally at traceon
     \exp_after:wN \l_@@_fn_code_tl \l_@@_args_tl
diff --git a/base/testfiles/github-0712.lvt b/base/testfiles/github-0712.lvt
new file mode 100644
index 00000000..5a535ad5
--- /dev/null
+++ b/base/testfiles/github-0712.lvt
@@ -0,0 +1,18 @@
+\documentclass{article}
+\input{test2e}
+
+\NewDocumentEnvironment{test}{O{x}}{#1}{#1}
+
+\begin{document}
+
+\START
+
+\showoutput
+
+\begin{test}
+text
+\end{test}
+
+\newpage
+
+\END
diff --git a/base/testfiles/tlb-utf8-bom.tlg b/base/testfiles/github-0712.tlg
similarity index 74%
copy from base/testfiles/tlb-utf8-bom.tlg
copy to base/testfiles/github-0712.tlg
index 865f028b..89e4a4fc 100644
--- a/base/testfiles/tlb-utf8-bom.tlg
+++ b/base/testfiles/github-0712.tlg
@@ -1,6 +1,5 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-(tlb-utf8-bom.lvt)
 Completed box being shipped out [1]
 \vbox(633.0+0.0)x407.0
 .\glue 16.0
@@ -13,13 +12,17 @@ Completed box being shipped out [1]
 ..\glue(\lineskip) 0.0
 ..\vbox(550.0+0.0)x345.0, glue set 539.94232fil
 ...\write-{}
-...\glue(\topskip) 3.05556
-...\hbox(6.94444+0.0)x345.0, glue set 311.63887fil
+...\glue(\topskip) 3.84921
+...\hbox(6.15079+0.0)x345.0, glue set 295.2777fil
 ....\hbox(0.0+0.0)x15.0
-....\OT1/cmr/m/n/10 h
-....\OT1/cmr/m/n/10 e
-....\OT1/cmr/m/n/10 r
+....\OT1/cmr/m/n/10 x
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 t
 ....\OT1/cmr/m/n/10 e
+....\OT1/cmr/m/n/10 x
+....\OT1/cmr/m/n/10 t
+....\glue 3.33333 plus 1.66666 minus 1.11111
+....\OT1/cmr/m/n/10 x
 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0
@@ -32,4 +35,3 @@ Completed box being shipped out [1]
 ....\glue 0.0 plus 1.0fil
 ....\OT1/cmr/m/n/10 1
 ....\glue 0.0 plus 1.0fil
-(tlb-utf8-bom.aux)





More information about the latex3-commits mailing list.