diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/base/ltcmd.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/base/ltcmd.dtx | 76 |
1 files changed, 51 insertions, 25 deletions
diff --git a/Master/texmf-dist/source/latex/base/ltcmd.dtx b/Master/texmf-dist/source/latex/base/ltcmd.dtx index d2f184c3f7d..59aa5bf475e 100644 --- a/Master/texmf-dist/source/latex/base/ltcmd.dtx +++ b/Master/texmf-dist/source/latex/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.0i} -\def\ltcmddate{2021-12-02} +\def\ltcmdversion{v1.0l} +\def\ltcmddate{2022-03-18} % \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> @@ -2352,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} @@ -2371,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_@@ @@ -4093,8 +4097,10 @@ % \begin{macro}{\@@_cmd_type_cases:Nnnnn} % \changes{v1.0d}{2021/04/19}{Renamed \cs{__cmd_cmd_if_xparse:NTF} to % \cs{__kernel_cmd_if_xparse:NTF} for cross-module usage} -% \changes{v1.0d}{2021/07/30}{Added \cs{@@_cmd_type_cases:Nnnnn} for +% \changes{v1.0d}{2021/07/30}{Added \cs{@@_cmd_type_cases:NnnnnF} for % \cs{NewCommandCopy} and \cs{ShowCommand} support} +% \changes{v1.0l}{2022/03/18}{Fix \cs{@@_cmd_type_cases:NnnnnF} +%" prematurely expanding macros (gh/795)} % \begin{macro}{\@@_cmd_if_xparse_aux:N} % % To determine whether the command is an \pkg{xparse} command check @@ -4113,22 +4119,14 @@ \exp_args:Ne \str_case_e:nnF { \exp_args:Nf \tl_if_empty:nT { \cs_argument_spec:N #1 } - { - \token_if_macro:NT #1 - { - \exp_after:wN \exp_after:wN - \exp_after:wN \token_to_str:N - \exp_after:wN \use_i_delimit_by_q_stop:nw - #1 \scan_stop: \q_stop - } - } + { \exp_not:N \exp_not:n { \exp_not:e { \tl_head:N #1 } } } } { - { \token_to_str:N \@@_start:nNNnnn } {#2} - { \token_to_str:N \@@_start_expandable:nNNNNn } {#3} - { \token_to_str:N \@@_start_env:nnnnn } {#4} + { \exp_not:N \@@_start:nNNnnn } {#2} + { \exp_not:N \@@_start_expandable:nNNNNn } {#3} + { \exp_not:N \@@_start_env:nnnnn } {#4} { - \exp_after:wN \token_to_str:N + \exp_after:wN \exp_not:N \cs:w environment~ \exp_last_unbraced:Ne \use_none:nnn { \cs_to_str:N #1 } ~end~aux \cs_end: @@ -4712,6 +4710,27 @@ % \end{macrocode} % \end{macro} % +% +% \begin{macro}{\IfBlankT, \IfBlankF, \IfBlankTF} +% Another simple re-naming. +% \changes{v1.0k}{2022/02/19}{Added \cs{IfBlankTF} and friends} +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{2022/06/01}% +%<latexrelease> {\IfBlankTF}{Testing~for~empty~or~blank}% +\cs_new_eq:NN \IfBlankF \tl_if_blank:nF +\cs_new_eq:NN \IfBlankT \tl_if_blank:nT +\cs_new_eq:NN \IfBlankTF \tl_if_blank:nTF +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2021/11/15}% +%<latexrelease> {\IfBlankTF}{Testing~for~empty~or~blank}% +%<latexrelease>\cs_undefine:N \IfBlankF +%<latexrelease>\cs_undefine:N \IfBlankT +%<latexrelease>\cs_undefine:N \IfBlankTF +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\ProcessedArgument} % Processed arguments are returned using this name, which is reserved % here although the definition will change. @@ -4775,7 +4794,14 @@ %<latexrelease> %<latexrelease>\EndModuleRelease \ExplSyntaxOff -%<latexrelease>\@ifundefined{ExplSyntaxOff}{}{\latexrelease@postexpl} +% \end{macrocode} +% +% Now in |latexrelease| mode, redefine \cs{NewDocumentCommand} to not +% complain on commands already defined. +% \changes{v1.0k}{2022-02-28} +% {Move latexrelease redefinitions from ltcmd.dtx} +% \begin{macrocode} +%<latexrelease>\@ifundefined{ExplSyntaxOff}{}{\latexrelease@postltcmd} %<latexrelease>\catcode`\^^@=\@latexrelease@catcode@null\relax %</2ekernel|latexrelease> % \end{macrocode} |