diff options
author | Norbert Preining <norbert@preining.info> | 2022-12-04 03:01:36 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-12-04 03:01:36 +0000 |
commit | b153d9b098596910fb2be9311f13c4415233c2a2 (patch) | |
tree | f0f44c9b4caa5756e6957885e8691c0268920a56 /macros/latex-dev/base/ltcmd.dtx | |
parent | 34896a353fe22e8ac88ef0b4e39f4fa878e2b0b6 (diff) |
CTAN sync 202212040301
Diffstat (limited to 'macros/latex-dev/base/ltcmd.dtx')
-rw-r--r-- | macros/latex-dev/base/ltcmd.dtx | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/macros/latex-dev/base/ltcmd.dtx b/macros/latex-dev/base/ltcmd.dtx index 14d6756f5c..30a1908c47 100644 --- a/macros/latex-dev/base/ltcmd.dtx +++ b/macros/latex-dev/base/ltcmd.dtx @@ -34,8 +34,8 @@ %%% From File: ltcmd.dtx % % \begin{macrocode} -\def\ltcmdversion{v1.1a} -\def\ltcmddate{2022-08-16} +\def\ltcmdversion{v1.1b} +\def\ltcmddate{2022-11-29} % \end{macrocode} % %<*driver> @@ -2401,21 +2401,28 @@ % \@@_show_command:NnNNwN, % \@@_show_expandable:N, % \@@_show_expandable:NnNNNNnN, -% \@@_show_command_aux:nNNn, +% \@@_show_command_aux:NnNNn, % \@@_show_environment:N, +% \@@_show:x, % } % These commands just expand the command once to reveal its innards, % then pass the type of command, the control sequence, the signature, -% and the code macro to \cs{@@_show_command_aux:nNNn}. +% and the code macro to \cs{@@_show_command_aux:NnNNn}. % \begin{macrocode} \cs_new_protected:Npn \@@_show_command:N #1 { \exp_after:wN \@@_show_command:NnNNwN #1 \q_@@ #1 } \cs_new_protected:Npn \@@_show_command:NnNNwN #1 #2 #3 #4 #5 \q_@@ #6 - { \@@_show_command_aux:nNNn { document~command } #6 #4 {#2} } + { + \@@_show_command_aux:NnNNn \tl_show:x + { document~command } #6 #4 {#2} + } \cs_new_protected:Npn \@@_show_expandable:N #1 { \exp_after:wN \@@_show_expandable:NnNNNNnN #1 #1 } \cs_new_protected:Npn \@@_show_expandable:NnNNNNnN #1 #2 #3 #4 #5 #6 #7 #8 - { \@@_show_command_aux:nNNn { expandable~document~command } #8 #5 {#2} } + { + \@@_show_command_aux:NnNNn \tl_show:x + { expandable~document~command } #8 #5 {#2} + } % \end{macrocode} % % Now just print everything in the required format. The auxiliary @@ -2423,27 +2430,31 @@ % \cs{l_@@_tmpa_tl}, so we ust use that here: % \changes{v1.0j}{2021/13/31} % {Make \cs{ShowCommand} stop for interaction} +% \changes{v1.1b}{2022/11/30} +% {Don't stop for the \cs{begin} part of an environment} % \begin{macrocode} -\cs_new_protected:Npn \@@_show_command_aux:nNNn #1 #2 #3 #4 +\cs_new_protected:Npn \@@_show_command_aux:NnNNn #1 #2 #3 #4 #5 { - \@@_split_signature:n {#4} - \tl_show:x + \@@_split_signature:n {#5} + #1 { - \token_to_str:N #2 = #1: \iow_newline: + \token_to_str:N #3 = #2: \iow_newline: \tl_use:N \l_@@_tmpa_tl - -> \cs_replacement_spec:N #3 + -> \cs_replacement_spec:N #4 } } % \end{macrocode} % % We can reuse most of the above to show an environment, except that % we need to ensure that the proper \cs[no-index]{environment~\ldots} -% are passed to \cs{@@_show_command_aux:nNNn}. Additionally, when +% are passed to \cs{@@_show_command_aux:NnNNn}. Additionally, when % |\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} +% \changes{v1.1b}{2022/11/30} +% {Don't stop for the \cs{begin} part of an environment} % \begin{macrocode} \cs_new_protected:Npn \@@_show_environment:N #1 { @@ -2459,12 +2470,14 @@ { \use:x { - \@@_show_command_aux:nNNn { document~environment } + \@@_show_command_aux:NnNNn \@@_show:x { document~environment } { \exp_not:N \begin {#3} } \exp_not:c { environment~ #3 ~ code } {#2} } } +\cs_new_protected:Npn \@@_show:x #1 + { \iow_term:x { > ~ #1 . \iow_newline: } } \cs_new_protected:Npn \@@_show_environment_end:N #1 { \exp_args:NNx \@@_check_end:Nn \l_@@_tmpa_tl { \cs_to_str:N #1 } @@ -2473,10 +2486,15 @@ % \end{macrocode} % % And, of course, add \cs{__kernel_cmd_if_xparse:NTF} and -% \cs{@@_show:N} to \cs{@showcommandlisthook}: +% \cs{@@_show:N} to \cs{@showcommandlisthook} and to +% \cs{@showenvironmentlisthook} (\cs{@@_show:N} takes care of the +% environment case as well, so both entries are identical): +% \changes{v1.1b}{2022-11-29}{Add \cs{@showenvironmentlisthook}} % \begin{macrocode} \tl_gput_right:Nn \@showcommandlisthook { { \__kernel_cmd_if_xparse:NTF \@@_show:N } } +\tl_gput_right:Nn \@showenvironmentlisthook + { { \__kernel_cmd_if_xparse:NTF \@@_show:N } } % \end{macrocode} % \end{macro} % |