summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2012-10-06 09:34:54 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2012-10-06 09:34:54 +0000
commit11eb9a3891b7dd3261bf06e2421e6ae87aba4153 (patch)
tree0a1ec8718e0c0ac641c4e7630e2278a438d9b11a /Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
parenta9a23194b1cababcf9c24e48937a726cb465813a (diff)
l3kernel update
git-svn-id: svn://tug.org/texlive/trunk@27898 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3msg.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3msg.dtx96
1 files changed, 49 insertions, 47 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
index a1e30326917..3d72db5db51 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
@@ -35,7 +35,7 @@
%
%<*driver|package>
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3msg.dtx 4147 2012-08-28 10:27:33Z bruno $
+\GetIdInfo$Id: l3msg.dtx 4212 2012-09-09 12:24:04Z bruno $
{L3 Messages}
%</driver|package>
%<*driver>
@@ -723,37 +723,37 @@
% completely.
% \end{function}
%
-% \begin{function}[updated = 2012-08-14]
-% {\__msg_show_variable:Nnn, \__msg_show_variable:Nnx}
+% \begin{function}[updated = 2012-09-09]{\__msg_show_variable:Nnn}
% \begin{syntax}
% \cs{__msg_show_variable:Nnn} \meta{variable} \Arg{type} \Arg{formatted content}
% \end{syntax}
-% Displays the \meta{formatted content} of the \meta{variable} of \meta{type}
-% in the terminal. The \meta{formatted content} will typically be generated
-% by \texttt{x}-type expansion using the \cs{__msg_show_variable:Nnx} variant:
-% the nature of the formatting is dependent on the calling module.
-% The \meta{formatted content} must be a string, either empty or
-% containing |>|; everything until the first |>| will be removed.
+% Displays the \meta{formatted content} of the \meta{variable} of
+% \meta{type} in the terminal. The \meta{formatted content} will be
+% processed as the first argument in a call to \cs{iow_wrap:nnnN},
+% hence |\\|, \verb*|\ | and other formatting sequences can be used.
+% Once expanded and processed, the \meta{formatted content} must
+% either be empty or contain |>|; everything until the first |>| will
+% be removed.
% \end{function}
%
-% \begin{function}{\__msg_show_variable:n, \__msg_show_variable:x}
+% \begin{function}[updated = 2012-09-09]{\__msg_show_variable:n}
% \begin{syntax}
-% \cs{__msg_show_variable:n} \Arg{formatted string}
+% \cs{__msg_show_variable:n} \Arg{formatted text}
% \end{syntax}
-% Shows the \meta{formatted string} on the terminal. After expansion,
-% unless it is empty, the \meta{formatted string} must contain |>|,
-% and the part of \meta{formatted string} before the first |>| is
+% Shows the \meta{formatted text} on the terminal. After expansion,
+% unless it is empty, the \meta{formatted text} must contain |>|,
+% and the part of \meta{formatted text} before the first |>| is
% removed. Failure to do so causes low-level \TeX{} errors.
% \end{function}
%
-% \begin{function}
+% \begin{function}[updated = 2012-09-09]
% {\__msg_show_item:n, \__msg_show_item:nn, \__msg_show_item_unbraced:nn}
% \begin{syntax}
% \cs{__msg_show_item:n} \meta{item}
% \cs{__msg_show_item:nn} \meta{item-key} \meta{item-value}
% \end{syntax}
% Auxiliary functions used within the argument of
-% \cs{__msg_show_variable:Nnx} to format variable items correctly for
+% \cs{__msg_show_variable:Nnn} to format variable items correctly for
% display. The \cs{__msg_show_item:n} version is used for simple lists,
% the \cs{__msg_show_item:nn} and \cs{__msg_show_item_unbraced:nn} versions
% for key--value like data structures.
@@ -2038,57 +2038,59 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int]{\@@_show_variable:Nnn, \@@_show_variable:Nnx}
-% \begin{macro}[int]{\@@_show_variable:n, \@@_show_variable:x}
-% \begin{macro}[aux,EXP]{\@@_show_variable:w}
-% The arguments of \cs{@@_show_variable:Nnx} are
+% \begin{macro}[int]{\@@_show_variable:Nnn}
+% \begin{macro}[int]{\@@_show_variable:n}
+% \begin{macro}[aux]{\@@_show_variable_aux:n}
+% \begin{macro}[aux, EXP]{\@@_show_variable_aux:w}
+% The arguments of \cs{@@_show_variable:Nnn} are
% \begin{itemize}
% \item The \meta{variable} to be shown.
-% \item The \texttt{TF} emptiness conditional for that type of variables.
% \item The type of the variable.
% \item A mapping of the form \cs{seq_map_function:NN} \meta{variable}
% \cs{@@_show_item:n}, which produces the formatted string.
% \end{itemize}
-% We remove a new line and \verb*|> | from the first item using
-% a \texttt{w}-type auxiliary, and the fact that \texttt{f}-expansion
-% removes a space. To avoid a low-level \TeX{} error if there is
-% an empty argument, a simple test is used to keep the output
-% \enquote{clean}. The odd \cs{exp_after:wN} which expands the closing
-% brace improves the output slightly.
+% As for \cs{__kernel_register_show:N}, check that the variable is
+% defined. If it is, output the introductory message, then show the
+% contents |#3| using \cs{@@_show_variable:n}. This wraps the
+% contents (with leading \verb*|> |) to a fixed number of characters
+% per line. The expansion of |#3| may either be empty or start with
+% \verb*|> |. A leading |>|, if present, is removed using a
+% \texttt{w}-type auxiliary, as well as a space following it (via
+% \texttt{f}-expansion). Note that we cannot remove the space as a
+% delimiter for the \texttt{w}-type auxiliary, because a line-break
+% may be taken there, and the space would then disappear. Finally,
+% the resulting token list \cs{l_@@_internal_tl} is displayed to the
+% terminal, with an odd \cs{exp_after:wN} which expands the closing
+% brace to improve the output slightly.
% \begin{macrocode}
\cs_new_protected:Npn \@@_show_variable:Nnn #1#2#3
{
\cs_if_exist:NTF #1
{
\@@_term:nnn { LaTeX / kernel } { show- #2 } {#1}
- \@@_show_variable:x { \tl_to_str:n {#3} }
+ \@@_show_variable:n {#3}
}
{
\@@_kernel_error:nnx { kernel } { variable-not-defined }
{ \token_to_str:N #1 }
}
}
-\cs_generate_variant:Nn \@@_show_variable:Nnn { Nnx }
\cs_new_protected:Npn \@@_show_variable:n #1
+ { \iow_wrap:nnnN {#1} { } { } \@@_show_variable_aux:n }
+\cs_new_protected:Npn \@@_show_variable_aux:n #1
{
- \tl_set:Nn \l_@@_internal_tl {#1}
- \tl_if_empty:NTF \l_@@_internal_tl
- { \etex_showtokens:D \exp_after:wN { } }
- {
- \exp_args:Nf \etex_showtokens:D
- {
- \exp_after:wN \exp_after:wN
- \exp_after:wN \@@_show_variable:w
- \exp_after:wN \l_@@_internal_tl
- }
- }
+ \tl_if_empty:nTF {#1}
+ { \tl_clear:N \l_@@_internal_tl }
+ { \tl_set:Nf \l_@@_internal_tl { \@@_show_variable_aux:w #1 } }
+ \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN
+ { \exp_after:wN \l_@@_internal_tl }
}
-\cs_generate_variant:Nn \@@_show_variable:n { x }
-\cs_new:Npn \@@_show_variable:w #1 > { }
+\cs_new:Npn \@@_show_variable_aux:w #1 > { }
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}[int,EXP]{\@@_show_item:n}
% \begin{macro}[int,EXP]{\@@_show_item:nn}
@@ -2098,17 +2100,17 @@
% \begin{macrocode}
\cs_new:Npn \@@_show_item:n #1
{
- \iow_newline: > \c_space_tl \c_space_tl { \exp_not:n {#1} }
+ \\ > \ \ \{ \tl_to_str:n {#1} \}
}
\cs_new:Npn \@@_show_item:nn #1#2
{
- \iow_newline: > \c_space_tl \c_space_tl { \exp_not:n {#1} }
- \c_space_tl \c_space_tl => \c_space_tl \c_space_tl { \exp_not:n {#2} }
+ \\ > \ \ \{ \tl_to_str:n {#1} \}
+ \ \ => \ \ \{ \tl_to_str:n {#2} \}
}
\cs_new:Npn \@@_show_item_unbraced:nn #1#2
{
- \iow_newline: > \c_space_tl \c_space_tl \exp_not:n {#1}
- \c_space_tl \c_space_tl => \c_space_tl \c_space_tl \exp_not:n {#2}
+ \\ > \ \ \tl_to_str:n {#1}
+ \ \ => \ \ \tl_to_str:n {#2}
}
% \end{macrocode}
% \end{macro}