[latex3-commits] [git/LaTeX3-latex3-latex2e] gh569: Some documentation (299bc13d)
PhelypeOleinik
phelype.oleinik at latex-project.org
Mon Aug 9 23:15:40 CEST 2021
Repository : https://github.com/latex3/latex2e
On branch : gh569
Link : https://github.com/latex3/latex2e/commit/299bc13d3af5a2a4e585de7cd3562a282f25300d
>---------------------------------------------------------------
commit 299bc13d3af5a2a4e585de7cd3562a282f25300d
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date: Mon Aug 9 18:15:40 2021 -0300
Some documentation
>---------------------------------------------------------------
299bc13d3af5a2a4e585de7cd3562a282f25300d
base/ltcmd.dtx | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 05a87b9a..3927dc29 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -2226,10 +2226,9 @@
% we'll just print stuff to the terminal.
%
% \begin{macro}{\@@_show:N}
-% This macro just branches to the proper copying command by using
-% \cs{@@_cmd_type_cases:NnnnF}. The copying command takes the names
-% of the commands to be copied to and from, and the actual commands
-% as its four arguments.
+% This macro just branches to the proper showing command by using
+% \cs{@@_cmd_type_cases:NnnnF}. The showing command takes the command
+% to be shown as argument.
% \begin{macrocode}
\cs_new_protected:Npn \@@_show:N #1
{
@@ -2246,7 +2245,21 @@
\int_set:Nn \tex_escapechar:D { \int_use:N \tex_escapechar:D }
}
}
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{
+% \@@_show_command:N,
+% \@@_show_command:NnNNwN,
+% \@@_show_expandable:N,
+% \@@_show_expandable:NnNNNNnN,
+% \@@_show_command_aux:nNNn,
+% \@@_show_environment:N,
+% }
+% 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}.
+% \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
@@ -2255,19 +2268,26 @@
{ \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} }
+% \end{macrocode}
+%
+% And now just pretty-print everything:
+% \begin{macrocode}
\cs_new_protected:Npn \@@_show_command_aux:nNNn #1 #2 #3 #4
{
- \iow_term:x { > ~ \token_to_str:N #2 = #1: }
- \iow_term:x { > ~ signature = \tl_to_str:n {#4} . }
\iow_term:x
{
+ > ~ \token_to_str:N #2 = #1: \iow_newline:
+ > ~ signature = \tl_to_str:n {#4} . \iow_newline:
> ~ \token_to_str:N #3 ~ (
\int_eval:n
{ \exp_args:Nf \str_count:n { \cs_argument_spec:N #3 } / 2 } ~
parameters ) : \cs_replacement_spec:N #3
}
}
+% \end{macrocode}
%
+% But complain when used with an environment:
+% \begin{macrocode}
\cs_new_protected:Npn \@@_show_environment:N #1
{ \msg_error:nn { cmd } { env-show } }
\msg_new:nnn { cmd } { env-show }
More information about the latex3-commits
mailing list.