summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/ltcmd.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/base/ltcmd.dtx')
-rw-r--r--macros/latex-dev/base/ltcmd.dtx32
1 files changed, 20 insertions, 12 deletions
diff --git a/macros/latex-dev/base/ltcmd.dtx b/macros/latex-dev/base/ltcmd.dtx
index 04be2abfbf..bf7ae4ea24 100644
--- a/macros/latex-dev/base/ltcmd.dtx
+++ b/macros/latex-dev/base/ltcmd.dtx
@@ -2,7 +2,7 @@
%
% Copyright (C) 1999 Frank Mittelbach, Chris Rowley, David Carlisle
% Copyright (C) 2004-2008 Frank Mittelbach, The LaTeX3 Project
-% Copyright (C) 2009-2021
+% Copyright (C) 2009-2022
% The LaTeX Project and any individual authors listed elsewhere
% in this file.
%
@@ -34,8 +34,8 @@
%%% From File: ltcmd.dtx
%
% \begin{macrocode}
-\def\ltcmdversion{v1.0h}
-\def\ltcmddate{2021-08-30}
+\def\ltcmdversion{v1.0j}
+\def\ltcmddate{2021-12-31}
% \end{macrocode}
%
%<*driver>
@@ -67,7 +67,7 @@
% documentation for \pkg{ltcmd} is provided as part of \texttt{usrguide3}. Here,
% additional material aimed at programmers is provided
%
-% \StopEventually{}
+% \MaybeStop{}
%
% \begin{macrocode}
%<@@=cmd>
@@ -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@traceon
\exp_after:wN \l_@@_fn_code_tl \l_@@_args_tl
@@ -2348,15 +2352,17 @@
% Now just print everything in the required format. The auxiliary
% \cs{@@_split_signature:n} stores a ready-to-print token list in
% \cs{l_@@_tmpa_tl}, so we ust use that here:
+% \changes{v1.0j}{2021/13/31}
+% {Make \cs{ShowCommand} stop for interaction}
% \begin{macrocode}
\cs_new_protected:Npn \@@_show_command_aux:nNNn #1 #2 #3 #4
{
\@@_split_signature:n {#4}
- \iow_term:x
+ \tl_show:x
{
- > ~ \token_to_str:N #2 = #1: \iow_newline:
+ \token_to_str:N #2 = #1: \iow_newline:
\tl_use:N \l_@@_tmpa_tl
- -> \cs_replacement_spec:N #3 .
+ -> \cs_replacement_spec:N #3
}
}
% \end{macrocode}
@@ -2367,15 +2373,17 @@
% |\ShowCommand\foo| is used (if |foo| is an environment), we show
% |\endfoo| as well, and when |\ShowCommand\endfoo| is used, change
% that to |\ShowCommand\foo| and do the same.
+% \changes{v1.0j}{2021/13/31}
+% {Make \cs{ShowCommand} stop for interaction}
% \begin{macrocode}
\cs_new_protected:Npn \@@_show_environment:N #1
{
\exp_after:wN \@@_show_environment:Nnnw #1 \q_@@
- \iow_term:x
+ \tl_show:x
{
- > ~ \token_to_str:N \end { \cs_to_str:N #1 } : \iow_newline:
+ \token_to_str:N \end { \cs_to_str:N #1 } : \iow_newline:
-> \exp_args:Nc \cs_replacement_spec:N
- { environment~ \cs_to_str:N #1 ~end~aux~ } .
+ { environment~ \cs_to_str:N #1 ~end~aux~ }
}
}
\cs_new_protected:Npn \@@_show_environment:Nnnw #1 #2 #3 #4 \q_@@