summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx540
1 files changed, 209 insertions, 331 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
index 7f24c5b9e74..3b8cf3368c5 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx
@@ -38,7 +38,7 @@
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3candidates.dtx 5677 2015-07-22 14:47:23Z joseph $
+\GetIdInfo$Id: l3candidates.dtx 5911 2015-09-03 08:24:00Z joseph $
{L3 Experimental additions to l3kernel}
%</driver|package>
%<*driver>
@@ -106,7 +106,7 @@
%
% \section{Additions to \pkg{l3basics}}
%
-% \begin{function}[added = 2014-08-22]{\cs_log:N, \cs_log:c}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-03]{\cs_log:N, \cs_log:c}
% \begin{syntax}
% \cs{cs_log:N} \meta{control sequence}
% \end{syntax}
@@ -115,7 +115,8 @@
% terminal.
% \end{function}
%
-% \begin{function}{\__kernel_register_log:N, \__kernel_register_log:c}
+% \begin{function}[updated = 2015-08-03]
+% {\__kernel_register_log:N, \__kernel_register_log:c}
% \begin{syntax}
% \cs{__kernel_register_log:N} \meta{register}
% \end{syntax}
@@ -497,7 +498,8 @@
%
% \section{Additions to \pkg{l3fp}}
%
-% \begin{function}[added = 2014-08-22]{\fp_log:N, \fp_log:c, \fp_log:n}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-07]
+% {\fp_log:N, \fp_log:c, \fp_log:n}
% \begin{syntax}
% \cs{fp_log:N} \meta{fp~var}
% \cs{fp_log:n} \Arg{floating point expression}
@@ -508,14 +510,14 @@
%
% \section{Additions to \pkg{l3int}}
%
-% \begin{function}[added = 2014-08-22]{\int_log:N, \int_log:c}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-03]{\int_log:N, \int_log:c}
% \begin{syntax}
% \cs{int_log:N} \meta{integer}
% \end{syntax}
% Writes the value of the \meta{integer} in the log file.
% \end{function}
%
-% \begin{function}[added = 2014-08-22]{\int_log:n}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-07]{\int_log:n}
% \begin{syntax}
% \cs{int_log:n} \Arg{integer expression}
% \end{syntax}
@@ -535,56 +537,53 @@
%
% \section{Additions to \pkg{l3msg}}
%
-% \begin{function}[added = 2014-08-22]{\__msg_log:nnn}
-% \begin{syntax}
-% \cs{__msg_log:nnn} \Arg{module} \Arg{message} \Arg{arg one}
-% \end{syntax}
-% Writes the \meta{message} from \meta{module} in the log file without
-% formatting. Used in messages which print complex variable contents
-% completely.
-% \end{function}
-%
-% \begin{function}[added = 2014-08-22]{\__msg_log_variable:Nnn}
-% \begin{syntax}
-% \cs{__msg_log_variable:Nnn} \meta{variable} \Arg{type} \Arg{formatted content}
-% \end{syntax}
-% Writes the \meta{formatted content} of the \meta{variable} of
-% \meta{type} in the log file. 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}[added = 2014-08-22]{\__msg_log_wrap:n}
-% \begin{syntax}
-% \cs{__msg_log_wrap:n} \Arg{formatted text}
-% \end{syntax}
-% Writes the \meta{formatted text} in the log file. 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}[added = 2014-08-22]
-% {\__msg_log_value:n, \__msg_log_value:x}
+% In very rare cases it may be necessary to produce errors in an
+% expansion-only context. The functions in this section should only be
+% used if there is no alternative approach using \cs{msg_error:nnnnnn}
+% or other non-expandable commands from the previous section. Despite
+% having a similar interface as non-expandable messages, expandable
+% errors must be handled internally very differently from normal error
+% messages, as none of the tools to print to the terminal or the log
+% file are expandable. As a result, the message text and arguments are
+% not expanded, and messages must be very short (with default settings,
+% they are truncated after approximately 50 characters). It is
+% advisable to ensure that the message is understandable even when
+% truncated. Another particularity of expandable messages is that they
+% cannot be redirected or turned off by the user.
+%
+% \begin{function}[EXP, added = 2015-08-06]
+% {
+% \msg_expandable_error:nnnnnn ,
+% \msg_expandable_error:nnnnn ,
+% \msg_expandable_error:nnnn ,
+% \msg_expandable_error:nnn ,
+% \msg_expandable_error:nn ,
+% \msg_expandable_error:nnffff ,
+% \msg_expandable_error:nnfff ,
+% \msg_expandable_error:nnff ,
+% \msg_expandable_error:nnf ,
+% }
% \begin{syntax}
-% \cs{__msg_log_value:n} \Arg{tokens}
+% \cs{msg_expandable_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
% \end{syntax}
-% Writes \verb*|> |\meta{tokens}|.| in the log file.
+% Issues an \enquote{Undefined error} message from \TeX{} itself
+% using the undefined control sequence \cs{::error} then prints
+% \enquote{! \meta{module}: }\meta{error message}, which should be
+% short. With default settings, anything beyond approximately $60$
+% characters long (or bytes in some engines) is cropped. A leading
+% space might be removed as well.
% \end{function}
%
% \section{Additions to \pkg{l3prg}}
%
-% \begin{function}[added = 2014-08-22]{\bool_log:N, \bool_log:c}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-03]{\bool_log:N, \bool_log:c}
% \begin{syntax}
% \cs{bool_log:N} \meta{boolean}
% \end{syntax}
% Writes the logical truth of the \meta{boolean} in the log file.
% \end{function}
%
-% \begin{function}[added = 2014-08-22]{\bool_log:n}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-07]{\bool_log:n}
% \begin{syntax}
% \cs{bool_log:n} \Arg{boolean expression}
% \end{syntax}
@@ -607,7 +606,7 @@
% \prop_map_tokens:Nn \l_my_prop { \str_if_eq:nnT { mykey } }
% \end{verbatim}
% will expand to the value corresponding to \texttt{mykey}: for each
-% pair in \cs{l_my_prop} the function \cs{str_if_eq:nnT} receives
+% pair in |\l_my_prop| the function \cs{str_if_eq:nnT} receives
% \texttt{mykey}, the \meta{key} and the \meta{value} as its three
% arguments. For that specific task, \cs{prop_item:Nn} is faster.
% \end{function}
@@ -695,14 +694,14 @@
% warning message of some sort.
% \end{function}
%
-% \begin{function}[added = 2014-08-22]{\dim_log:N, \dim_log:c}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-03]{\dim_log:N, \dim_log:c}
% \begin{syntax}
% \cs{dim_log:N} \meta{dimension}
% \end{syntax}
% Writes the value of the \meta{dimension} in the log file.
% \end{function}
%
-% \begin{function}[added = 2014-08-22]{\dim_log:n}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-07]{\dim_log:n}
% \begin{syntax}
% \cs{dim_log:n} \Arg{dimension expression}
% \end{syntax}
@@ -710,14 +709,14 @@
% in the log file.
% \end{function}
%
-% \begin{function}[added = 2014-08-22]{\skip_log:N, \skip_log:c}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-03]{\skip_log:N, \skip_log:c}
% \begin{syntax}
% \cs{skip_log:N} \meta{skip}
% \end{syntax}
% Writes the value of the \meta{skip} in the log file.
% \end{function}
%
-% \begin{function}[added = 2014-08-22]{\skip_log:n}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-07]{\skip_log:n}
% \begin{syntax}
% \cs{skip_log:n} \Arg{skip expression}
% \end{syntax}
@@ -725,14 +724,14 @@
% in the log file.
% \end{function}
%
-% \begin{function}[added = 2014-08-22]{\muskip_log:N, \muskip_log:c}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-03]{\muskip_log:N, \muskip_log:c}
% \begin{syntax}
% \cs{muskip_log:N} \meta{muskip}
% \end{syntax}
% Writes the value of the \meta{muskip} in the log file.
% \end{function}
%
-% \begin{function}[added = 2014-08-22]{\muskip_log:n}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-07]{\muskip_log:n}
% \begin{syntax}
% \cs{muskip_log:n} \Arg{muskip expression}
% \end{syntax}
@@ -784,7 +783,7 @@
% giving an \meta{integer denotation}.
% \end{function}
%
-% \begin{function}[EXP]{\tl_expandable_uppercase:n,\tl_expandable_lowercase:n}
+% \begin{function}[EXP]{\tl_expandable_uppercase:n, \tl_expandable_lowercase:n}
% \begin{syntax}
% \cs{tl_expandable_uppercase:n} \Arg{tokens}
% \cs{tl_expandable_lowercase:n} \Arg{tokens}
@@ -1017,7 +1016,7 @@
% argument.
% \end{function}
%
-% \begin{function}[added = 2014-08-22]{\tl_log:N, \tl_log:c}
+% \begin{function}[added = 2014-08-22, updated = 2015-08-01]{\tl_log:N, \tl_log:c}
% \begin{syntax}
% \cs{tl_log:N} \meta{tl~var}
% \end{syntax}
@@ -1035,52 +1034,29 @@
%
% \section{Additions to \pkg{l3tokens}}
%
-% \begin{function}{\char_set_active:Npn, \char_set_active:Npx}
-% \begin{syntax}
-% \cs{char_set_active:Npn} \meta{char} \meta{parameters} \Arg{code}
-% \end{syntax}
-% Makes \meta{char} an active character to expand to \meta{code} as
-% replacement text.
-% Within the \meta{code}, the \meta{parameters} (|#1|, |#2|,
-% \emph{etc.}) will be replaced by those absorbed. The \meta{char} is
-% made active within the current \TeX{} group level, and the definition
-% is also local.
-% \end{function}
-%
-% \begin{function}{\char_gset_active:Npn, \char_gset_active:Npx}
-% \begin{syntax}
-% \cs{char_gset_active:Npn} \meta{char} \meta{parameters} \Arg{code}
-% \end{syntax}
-% Makes \meta{char} an active character to expand to \meta{code} as
-% replacement text.
-% Within the \meta{code}, the \meta{parameters} (|#1|, |#2|,
-% \emph{etc.}) will be replaced by those absorbed. The \meta{char} is
-% made active within the current \TeX{} group level, but the definition
-% is global. This function is therefore suited to cases where an active
-% character definition should be applied only in some context (where the
-% \meta{char} is again made active).
-% \end{function}
-%
-% \begin{function}{\char_set_active_eq:NN}
+% \begin{function}[updated = 2015-09-01]
+% {\char_set_active_eq:NN, \char_gset_active_eq:NN}
% \begin{syntax}
% \cs{char_set_active_eq:NN} \meta{char} \meta{function}
% \end{syntax}
-% Makes \meta{char} an active character equivalent in meaning to the
-% \meta{function} (which may itself be an active character). The \meta{char}
-% is made active within the current \TeX{} group level, and the definition
-% is also local.
+% Sets the behaviour of the \meta{char} in situations where it is
+% active (category code $13$) to be equivalent to that of the
+% \meta{function}. The category code of the \meta{char} is
+% \emph{unchanged} by this process. The \meta{function} may itself
+% be an active character.
% \end{function}
%
-% \begin{function}{\char_gset_active_eq:NN}
+% \begin{function}[added = 2015-09-02]
+% {\char_set_active_eq:nN, \char_gset_active_eq:nN}
% \begin{syntax}
-% \cs{char_gset_active_eq:NN} \meta{char} \meta{function}
+% \cs{char_set_active_eq:nN} \Arg{integer expression} \meta{function}
% \end{syntax}
-% Makes \meta{char} an active character equivalent in meaning to the
-% \meta{function} (which may itself be an active character). The \meta{char}
-% is made active within the current \TeX{} group level, but the definition
-% is global. This function is therefore suited to cases where an active
-% character definition should be applied only in some context (where the
-% \meta{char} is again made active).
+% Sets the behaviour of the \meta{char} which has character
+% code as given by the \meta{integer expression} in situations
+% where it is active (category code $13$) to be equivalent to that of the
+% \meta{function}. The category code of the \meta{char} is
+% \emph{unchanged} by this process. The \meta{function} may itself
+% be an active character.
% \end{function}
%
% \begin{function}[TF, updated = 2012-12-20]{\peek_N_type:}
@@ -1120,43 +1096,24 @@
% \end{macrocode}
%
% \begin{macro}{\cs_log:N, \cs_log:c}
-% The same as \cs{cs_show:N} and \cs{cs_show:c}, but using
-% \cs{__msg_log_wrap:n} instead of \cs{__msg_show_variable:n}.
-% \begin{macrocode}
-\group_begin:
- \tex_lccode:D `? = `: \scan_stop:
- \tex_catcode:D `? = 12 \scan_stop:
-\tex_lowercase:D
- {
- \group_end:
- \cs_new_protected:Npn \cs_log:N #1
- {
- \__msg_log_wrap:n
- {
- > ~ \token_to_str:N #1 =
- \exp_after:wN \@@_show:www \cs_meaning:N #1
- \use_none:nn ? \prg_do_nothing:
- }
- }
- }
+% Use \cs{cs_show:N} or \cs{cs_show:c} after calling
+% \cs{__msg_log_next:} to redirect their output to the log file only.
+% Note that \cs{cs_log:c} is not just a variant of \cs{cs_log:N} as
+% the csname should be turned to a control sequence within a group
+% (see \cs{cs_show:c}).
+% \begin{macrocode}
+\cs_new_protected_nopar:Npn \cs_log:N
+ { \__msg_log_next: \cs_show:N }
\cs_new_protected_nopar:Npn \cs_log:c
- { \group_begin: \exp_args:NNc \group_end: \cs_log:N }
+ { \__msg_log_next: \cs_show:c }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[int]{\__kernel_register_log:N, \__kernel_register_log:c}
-% Check that the variable exists, then write its name and value to the
-% log file.
+% Redirect the output of \cs{__kernel_register_show:N} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \__kernel_register_log:N #1
- {
- \cs_if_exist:NTF #1
- { \__msg_log_value:x { \token_to_str:N #1 = \tex_the:D #1 } }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
- }
- }
+\cs_new_protected_nopar:Npn \__kernel_register_log:N
+ { \__msg_log_next: \__kernel_register_show:N }
\cs_generate_variant:Nn \__kernel_register_log:N { c }
% \end{macrocode}
% \end{macro}
@@ -1813,18 +1770,12 @@
% \end{macrocode}
%
% \begin{macro}{\clist_log:N, \clist_log:c, \clist_log:n}
-% Same as \cs{clist_show:N} but using \cs{__msg_log_variable:Nnn}.
+% Redirect output of \cs{clist_show:N} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \clist_log:N #1
- {
- \__msg_log_variable:Nnn #1 { clist }
- { \clist_map_function:NN #1 \__msg_show_item:n }
- }
-\cs_new_protected:Npn \clist_log:n #1
- {
- \clist_set:Nn \l_@@_internal_clist {#1}
- \clist_log:N \l_@@_internal_clist
- }
+\cs_new_protected_nopar:Npn \clist_log:N
+ { \__msg_log_next: \clist_show:N }
+\cs_new_protected_nopar:Npn \clist_log:n
+ { \__msg_log_next: \clist_show:n }
\cs_generate_variant:Nn \clist_log:N { c }
% \end{macrocode}
% \end{macro}
@@ -2292,21 +2243,10 @@
% \subsection{Coffin diagnostics}
%
% \begin{macro}{\coffin_log_structure:N, \coffin_log_structure:c}
-% Same as \cs{coffin_show_structure:N}, but using
-% \cs{__msg_log_variable:Nnn}.
+% Redirect output of \cs{coffin_show_structure:N} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \coffin_log_structure:N #1
- {
- \@@_if_exist:NT #1
- {
- \__msg_log_variable:Nnn #1 { coffins }
- {
- \prop_map_function:cN
- { l_@@_poles_ \__int_value:w #1 _prop }
- \__msg_show_item_unbraced:nn
- }
- }
- }
+\cs_new_protected_nopar:Npn \coffin_log_structure:N
+ { \__msg_log_next: \coffin_show_structure:N }
\cs_generate_variant:Nn \coffin_log_structure:N { c }
% \end{macrocode}
% \end{macro}
@@ -2411,68 +2351,38 @@
% \end{macro}
%
% \begin{macro}{\ior_log_streams:}
-% \begin{macro}[aux]{\@@_log_streams:Nn}
-% Same as \cs{ior_list_streams:}, but with \cs{__msg_log:nnn} and
-% \cs{__msg_log_wrap:n}.
+% Redirect output of \cs{ior_list_streams:} to the log.
% \begin{macrocode}
\cs_new_protected_nopar:Npn \ior_log_streams:
- { \@@_log_streams:Nn \g_@@_streams_prop { input } }
-\cs_new_protected:Npn \@@_log_streams:Nn #1#2
- {
- \__msg_log:nnn { LaTeX / kernel }
- { \prop_if_empty:NTF #1 { show-no-stream } { show-open-streams } }
- {#2}
- \__msg_log_wrap:n
- { \prop_map_function:NN #1 \__msg_show_item_unbraced:nn }
- }
+ { \__msg_log_next: \ior_list_streams: }
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \begin{macrocode}
%<@@=iow>
% \end{macrocode}
%
% \begin{macro}{\iow_log_streams:}
-% \begin{macro}[aux]{\@@_log_streams:Nn}
-% Same as \cs{iow_list_streams:}, but with \cs{__msg_log:nnn} and
-% \cs{__msg_log_wrap:n}.
+% Redirect output of \cs{iow_list_streams:} to the log.
% \begin{macrocode}
\cs_new_protected_nopar:Npn \iow_log_streams:
- { \@@_log_streams:Nn \g_@@_streams_prop { output } }
-\cs_new_protected:Npn \@@_log_streams:Nn #1#2
- {
- \__msg_log:nnn { LaTeX / kernel }
- { \prop_if_empty:NTF #1 { show-no-stream } { show-open-streams } }
- {#2}
- \__msg_log_wrap:n
- { \prop_map_function:NN #1 \__msg_show_item_unbraced:nn }
- }
+ { \__msg_log_next: \iow_list_streams: }
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
-% \subsection{Additions to \pkg{l3fp}}
+% \subsection{Additions to \pkg{l3fp-assign}}
%
% \begin{macrocode}
%<@@=fp>
% \end{macrocode}
%
% \begin{macro}{\fp_log:N, \fp_log:c, \fp_log:n}
-% Same as \cs{fp_show:N} but using \cs{__msg_log_value:x} since we
-% know that the result is short.
+% Redirect output of \cs{fp_show:N} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \fp_log:N #1
- {
- \fp_if_exist:NTF #1
- { \__msg_log_value:x { \token_to_str:N #1 = \fp_to_tl:N #1 } }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
- }
- }
-\cs_new_protected:Npn \fp_log:n #1
- { \__msg_log_value:x { \fp_to_tl:n {#1} } }
+\cs_new_protected_nopar:Npn \fp_log:N
+ { \__msg_log_next: \fp_show:N }
+\cs_new_protected_nopar:Npn \fp_log:n
+ { \__msg_log_next: \fp_show:n }
\cs_generate_variant:Nn \fp_log:N { c }
% \end{macrocode}
% \end{macro}
@@ -2480,18 +2390,22 @@
% \subsection{Additions to \pkg{l3int}}
%
% \begin{macro}{\int_log:N, \int_log:c}
-% Simple copies.
+% Redirect output of \cs{int_show:N} to the log. This is not just a
+% copy of \cs{__kernel_register_log:N} because of subtleties
+% involving \tn{currentgrouplevel} and \tn{currentgrouptype}. See
+% \cs{int_show:N} for details.
% \begin{macrocode}
-\cs_new_eq:NN \int_log:N \__kernel_register_log:N
-\cs_new_eq:NN \int_log:c \__kernel_register_log:c
+\cs_new_protected_nopar:Npn \int_log:N
+ { \__msg_log_next: \int_show:N }
+\cs_generate_variant:Nn \int_log:N { c }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\int_log:n}
-% Use \cs{__msg_log_value:x}.
+% Redirect output of \cs{int_show:n} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \int_log:n #1
- { \__msg_log_value:x { \int_eval:n {#1} } }
+\cs_new_protected_nopar:Npn \int_log:n
+ { \__msg_log_next: \int_show:n }
% \end{macrocode}
% \end{macro}
%
@@ -2502,11 +2416,10 @@
% \end{macrocode}
%
% \begin{macro}{\keys_log:nn}
-% See \cs{keys_show:nn} but using \cs{cs_log:c} instead of
-% \cs{show:c}.
+% Redirect output of \cs{keys_show:nn} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \keys_log:nn #1#2
- { \cs_log:c { \c_@@_code_root_tl #1 / \tl_to_str:n {#2} } }
+\cs_new_protected_nopar:Npn \keys_log:nn
+ { \__msg_log_next: \keys_show:nn }
% \end{macrocode}
% \end{macro}
%
@@ -2516,60 +2429,52 @@
%<@@=msg>
% \end{macrocode}
%
-% \begin{macro}[int]{\@@_log:nnn}
-% Print the text of a message to the terminal without formatting:
-% short cuts around \cs{iow_wrap:nnnN}.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_log:nnn #1#2#3
- {
- \iow_wrap:nnnN
- { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} { } { } { } }
- { } { } \iow_log:n
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[int]{\@@_log_variable:Nnn, \@@_log_wrap:n}
-% \begin{macro}[aux]{\@@_log:n}
-% This is a direct analogue of \cs{@@_show_variable:Nnn}, but writing
-% to the log file instead of the terminal. It is important to pass to
-% \cs{iow_wrap:nnnN} the whole text that will be written in the log,
-% including the trailing period, as it would otherwise not be
-% formatted correctly. Note that we detect the case where nothing
-% would be shown, and add |>~| at the start: this is safe unless lines
-% are less than $3$~characters long.
+% \begin{macro}[EXP]
+% {
+% \msg_expandable_error:nnnnnn ,
+% \msg_expandable_error:nnnnn ,
+% \msg_expandable_error:nnnn ,
+% \msg_expandable_error:nnn ,
+% \msg_expandable_error:nn ,
+% \msg_expandable_error:nnffff ,
+% \msg_expandable_error:nnfff ,
+% \msg_expandable_error:nnff ,
+% \msg_expandable_error:nnf
+% }
+% \begin{macro}[aux]{\__msg_expandable_error_module:nn}
+% Pass to an auxiliary the message to display and the module name
% \begin{macrocode}
-\cs_new_protected:Npn \@@_log_variable:Nnn #1#2#3
+\cs_new:Npn \msg_expandable_error:nnnnnn #1#2#3#4#5#6
{
- \cs_if_exist:NTF #1
- {
- \@@_log:nnn { LaTeX / kernel } { show- #2 } {#1}
- \@@_log_wrap:n {#3}
- }
+ \exp_args:Nf \@@_expandable_error_module:nn
{
- \@@_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
+ \exp_args:Nf \tl_to_str:n
+ { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} }
}
+ {#1}
+ }
+\cs_new:Npn \msg_expandable_error:nnnnn #1#2#3#4#5
+ { \msg_expandable_error:nnnnnn {#1} {#2} {#3} {#4} {#5} { } }
+\cs_new:Npn \msg_expandable_error:nnnn #1#2#3#4
+ { \msg_expandable_error:nnnnnn {#1} {#2} {#3} {#4} { } { } }
+\cs_new:Npn \msg_expandable_error:nnn #1#2#3
+ { \msg_expandable_error:nnnnnn {#1} {#2} {#3} { } { } { } }
+\cs_new:Npn \msg_expandable_error:nn #1#2
+ { \msg_expandable_error:nnnnnn {#1} {#2} { } { } { } { } }
+\cs_generate_variant:Nn \msg_expandable_error:nnnnnn { nnffff }
+\cs_generate_variant:Nn \msg_expandable_error:nnnnn { nnfff }
+\cs_generate_variant:Nn \msg_expandable_error:nnnn { nnff }
+\cs_generate_variant:Nn \msg_expandable_error:nnn { nnf }
+\cs_new:Npn \@@_expandable_error_module:nn #1#2
+ {
+ \exp_after:wN \exp_after:wN
+ \exp_after:wN \use_none_delimit_by_q_stop:w
+ \use:n { \::error ! ~ #2 : ~ #1 } \q_stop
}
-\cs_new_protected:Npn \@@_log_wrap:n #1
- { \iow_wrap:nnnN { #1 . } { } { } \@@_log:n }
-\cs_new_protected:Npn \@@_log:n #1
- { \iow_log:x { \tl_if_single:nT {#1} { > ~ } #1 } }
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int]{\@@_log_value:n, \@@_log_value:x}
-% Write the tokens |#1| to the log file without line wrapping but with
-% a formatting similar to what is done by the commands which show
-% material to the terminal.
-% \begin{macrocode}
-\cs_new_protected:Npn \@@_log_value:n #1
- { \iow_log:n { >~ #1 . } }
-\cs_generate_variant:Nn \@@_log_value:n { x }
-% \end{macrocode}
-% \end{macro}
-%
% \subsection{Additions to \pkg{l3prg}}
%
% \begin{macrocode}
@@ -2577,29 +2482,15 @@
% \end{macrocode}
%
% \begin{macro}{\bool_log:N, \bool_log:c, \bool_log:n}
-% \begin{macro}[aux]{\@@_to_word:n}
-% Writes in the log file the truth value of the boolean, as
-% \texttt{true} or \texttt{false}. We use \cs{__msg_log_value:x}.
+% Redirect output of \cs{bool_show:N} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \bool_log:N #1
- {
- \bool_if_exist:NTF #1
- {
- \__msg_log_value:x
- { \token_to_str:N #1 = \@@_to_word:n {#1} }
- }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
- }
- }
-\cs_new_protected:Npn \bool_log:n #1
- { \__msg_log_value:x { \@@_to_word:n {#1} } }
-\cs_new:Npn \@@_to_word:n #1 { \bool_if:nTF {#1} { true } { false } }
+\cs_new_protected_nopar:Npn \bool_log:N
+ { \__msg_log_next: \bool_show:N }
+\cs_new_protected_nopar:Npn \bool_log:n
+ { \__msg_log_next: \bool_show:n }
\cs_generate_variant:Nn \bool_log:N { c }
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
% \subsection{Additions to \pkg{l3prop}}
%
@@ -2637,13 +2528,10 @@
% \end{macro}
%
% \begin{macro}{\prop_log:N, \prop_log:c}
-% Same as \cs{prop_show:N} but using \cs{__msg_log_variable:Nnn}.
+% Redirect output of \cs{prop_show:N} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \prop_log:N #1
- {
- \__msg_log_variable:Nnn #1 { prop }
- { \prop_map_function:NN #1 \__msg_show_item:nn }
- }
+\cs_new_protected_nopar:Npn \prop_log:N
+ { \__msg_log_next: \prop_show:N }
\cs_generate_variant:Nn \prop_log:N { c }
% \end{macrocode}
% \end{macro}
@@ -2726,7 +2614,7 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\seq_set_map:NNn,\seq_gset_map:NNn}
+% \begin{macro}{\seq_set_map:NNn, \seq_gset_map:NNn}
% \begin{macro}[aux]{\@@_set_map:NNNn}
% Very similar to \cs{seq_set_filter:NNn}. We could actually
% merge the two within a single function, but it would have weird
@@ -2747,13 +2635,10 @@
% \end{macro}
%
% \begin{macro}{\seq_log:N, \seq_log:c}
-% Same as \cs{seq_show:N} but using \cs{__msg_show_variable:Nnn}.
+% Redirect output of \cs{seq_show:N} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \seq_log:N #1
- {
- \__msg_log_variable:Nnn #1 { seq }
- { \seq_map_function:NN #1 \__msg_show_item:n }
- }
+\cs_new_protected_nopar:Npn \seq_log:N
+ { \__msg_log_next: \seq_show:N }
\cs_generate_variant:Nn \seq_log:N { c }
% \end{macrocode}
% \end{macro}
@@ -2789,32 +2674,32 @@
% \end{macro}
%
% \begin{macro}{\dim_log:N, \dim_log:c, \dim_log:n}
-% Diagnostics.
+% Diagnostics. Redirect output of \cs{dim_show:n} to the log.
% \begin{macrocode}
\cs_new_eq:NN \dim_log:N \__kernel_register_log:N
\cs_new_eq:NN \dim_log:c \__kernel_register_log:c
-\cs_new_protected:Npn \dim_log:n #1
- { \__msg_log_value:x { \dim_eval:n {#1} } }
+\cs_new_protected_nopar:Npn \dim_log:n
+ { \__msg_log_next: \dim_show:n }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\skip_log:N, \skip_log:c, \skip_log:n}
-% Diagnostics.
+% Diagnostics. Redirect output of \cs{skip_show:n} to the log.
% \begin{macrocode}
\cs_new_eq:NN \skip_log:N \__kernel_register_log:N
\cs_new_eq:NN \skip_log:c \__kernel_register_log:c
-\cs_new_protected:Npn \skip_log:n #1
- { \__msg_log_value:x { \skip_eval:n {#1} } }
+\cs_new_protected_nopar:Npn \skip_log:n
+ { \__msg_log_next: \skip_show:n }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\muskip_log:N, \muskip_log:c, \muskip_log:n}
-% Diagnostics.
+% Diagnostics. Redirect output of \cs{muskip_show:n} to the log.
% \begin{macrocode}
\cs_new_eq:NN \muskip_log:N \__kernel_register_log:N
\cs_new_eq:NN \muskip_log:c \__kernel_register_log:c
-\cs_new_protected:Npn \muskip_log:n #1
- { \__msg_log_value:x { \muskip_eval:n {#1} } }
+\cs_new_protected_nopar:Npn \muskip_log:n
+ { \__msg_log_next: \muskip_show:n }
% \end{macrocode}
% \end{macro}
%
@@ -2840,7 +2725,7 @@
{
\tl_if_empty:nTF {#1}
{ \prg_return_false: }
- { \@@_if_empty_return:o { \tex_romannumeral:D -`0 #1 } }
+ { \@@_if_empty_return:o { \exp:w \exp_end_continue_f:w #1 } }
}
}
% \end{macrocode}
@@ -2854,7 +2739,7 @@
{
\etex_unexpanded:D \exp_after:wN
{
- \tex_romannumeral:D
+ \exp:w
\@@_act:NNNnn
\@@_reverse_normal:nN
\@@_reverse_group:nn
@@ -2888,11 +2773,12 @@
%
% \begin{macro}[EXP]{\tl_count_tokens:n}
% \begin{macro}[EXP,aux]{\@@_act_count_normal:nN,
-% \@@_act_count_group:nn,\@@_act_count_space:n}
+% \@@_act_count_group:nn, \@@_act_count_space:n}
% The token count is computed through an \cs{int_eval:n} construction.
% Each \texttt{1+} is output to the \emph{left}, into the integer
-% expression, and the sum is ended by the \cs{c_zero} inserted by
-% \cs{@@_act_end:wn}. Somewhat a hack.
+% expression, and the sum is ended by the \cs{exp_end:} inserted by
+% \cs{@@_act_end:wn} (which is technically implemented as \cs{c_zero}).
+% Somewhat a hack!
% \begin{macrocode}
\cs_new:Npn \tl_count_tokens:n #1
{
@@ -2932,9 +2818,9 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{macro}[EXP]{\tl_expandable_uppercase:n,\tl_expandable_lowercase:n}
+% \begin{macro}[EXP]{\tl_expandable_uppercase:n, \tl_expandable_lowercase:n}
% \begin{macro}[EXP,aux]{\@@_act_case_normal:nN,
-% \@@_act_case_group:nn,\@@_act_case_space:n}
+% \@@_act_case_group:nn, \@@_act_case_space:n}
% The only difference between uppercasing and lowercasing is
% the table of correspondence that is used. As for other
% token list actions, we feed \cs{@@_act:NNNnn} three
@@ -2945,14 +2831,14 @@
% tests, and converted if necessary to upper/lowercase,
% before being output. For a group, we must perform the
% conversion within the group (the \cs{exp_after:wN} trigger
-% \tn{romannumeral}, which expands fully to give the
+% \cs{exp:w}, which expands fully to give the
% converted group), then output.
% \begin{macrocode}
\cs_new:Npn \tl_expandable_uppercase:n #1
{
\etex_unexpanded:D \exp_after:wN
{
- \tex_romannumeral:D
+ \exp:w
\@@_act_case_aux:nn { \c_@@_act_uppercase_tl } {#1}
}
}
@@ -2960,7 +2846,7 @@
{
\etex_unexpanded:D \exp_after:wN
{
- \tex_romannumeral:D
+ \exp:w
\@@_act_case_aux:nn { \c_@@_act_lowercase_tl } {#1}
}
}
@@ -2985,7 +2871,7 @@
\exp_after:wN \@@_act_output:n \exp_after:wN
{
\exp_after:wN
- { \tex_romannumeral:D \@@_act_case_aux:nn {#1} {#2} }
+ { \exp:w \@@_act_case_aux:nn {#1} {#2} }
}
}
% \end{macrocode}
@@ -3150,7 +3036,7 @@
{
\etex_unexpanded:D \exp_after:wN
{
- \tex_romannumeral:D
+ \exp:w
\@@_change_case_aux:nnn {#1} {#2} {#3}
}
}
@@ -3179,7 +3065,7 @@
% up for \texttt{f}-type expandability has two requirements: a marker
% token after the main loop (see above) and a mechanism to \enquote{load}
% and finalise the result. That is handled in the code below, which includes
-% the necessary material to end the \tn{romannumeral} expansion.
+% the necessary material to end the \cs{exp:w} expansion.
% \begin{macrocode}
\cs_new:Npn \@@_change_case_output:nwn #1#2 \@@_change_case_result:n #3
{ #2 \@@_change_case_result:n { #3 #1 } }
@@ -3187,7 +3073,7 @@
\cs_new:Npn \@@_change_case_end:wn #1 \@@_change_case_result:n #2
{
\group_align_safe_end:
- \c_zero
+ \exp_end:
#2
}
% \end{macrocode}
@@ -3206,7 +3092,7 @@
{
\exp_after:wN
{
- \tex_romannumeral:D
+ \exp:w
\@@_change_case_aux:nnn {#3} {#4} {#1}
}
}
@@ -3872,7 +3758,7 @@
{
\etex_unexpanded:D \exp_after:wN
{
- \tex_romannumeral:D
+ \exp:w
\@@_mixed_case_aux:nn {#1} {#2}
}
}
@@ -3900,7 +3786,7 @@
{
\exp_after:wN
{
- \tex_romannumeral:D
+ \exp:w
\@@_mixed_case_aux:nn {#3} {#1}
}
}
@@ -4404,27 +4290,19 @@
% \end{variable}
%
% \begin{macro}{\tl_log:N, \tl_log:c}
-% Showing token list variables in the log file is done after checking
-% that the variable is defined.
+% Redirect output of \cs{tl_show:N} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \tl_log:N #1
- {
- \tl_if_exist:NTF #1
- { \cs_log:N #1 }
- {
- \__msg_kernel_error:nnx { kernel } { variable-not-defined }
- { \token_to_str:N #1 }
- }
- }
+\cs_new_protected_nopar:Npn \tl_log:N
+ { \__msg_log_next: \tl_show:N }
\cs_generate_variant:Nn \tl_log:N { c }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tl_log:n}
-% The same as \cs{tl_show:n} but using \cs{__msg_log_wrap:n}.
+% Redirect output of \cs{tl_show:n} to the log.
% \begin{macrocode}
-\cs_new_protected:Npn \tl_log:n #1
- { \__msg_log_wrap:n { > ~ \tl_to_str:n {#1} } }
+\cs_new_protected_nopar:Npn \tl_log:n
+ { \__msg_log_next: \tl_show:n }
% \end{macrocode}
% \end{macro}
%
@@ -4434,33 +4312,33 @@
%<@@=char>
% \end{macrocode}
%
-% \begin{macro}{\char_set_active:Npn,\char_set_active:Npx}
-% \begin{macro}{\char_gset_active:Npn,\char_gset_active:Npx}
-% \begin{macro}{\char_set_active_eq:NN,\char_gset_active_eq:NN}
+% \begin{macro}
+% {^^A
+% \char_set_active_eq:NN, \char_gset_active_eq:NN,
+% \char_set_active_eq:nN, \char_gset_active_eq:nN
+% }
+% Four simple functions with very similar definitions, so set up using
+% an auxiliary.
% \begin{macrocode}
\group_begin:
\char_set_catcode_active:N \^^@
- \cs_set:Npn \char_tmp:NN #1#2
+ \cs_set_protected:Npn \@@_tmp:nN #1#2
{
- \cs_new:Npn #1 ##1
+ \cs_new_protected:cpn { #1 :nN } ##1
{
- \char_set_catcode_active:n { `##1 }
\group_begin:
- \char_set_lccode:nn { `\^^@ } { `##1 }
- \tl_to_lowercase:n { \group_end: #2 ^^@ }
+ \char_set_catcode_active:n { ##1 }
+ \char_set_lccode:nn { `\^^@ } { ##1 }
+ \tex_lowercase:D { \group_end: #2 ^^@ }
}
+ \cs_new_protected:cpx { #1 :NN } ##1
+ { \exp_not:c { #1 : nN } { `##1 } }
}
- \char_tmp:NN \char_set_active:Npn \cs_set:Npn
- \char_tmp:NN \char_set_active:Npx \cs_set:Npx
- \char_tmp:NN \char_gset_active:Npn \cs_gset:Npn
- \char_tmp:NN \char_gset_active:Npx \cs_gset:Npx
- \char_tmp:NN \char_set_active_eq:NN \cs_set_eq:NN
- \char_tmp:NN \char_gset_active_eq:NN \cs_gset_eq:NN
+ \@@_tmp:nN { char_set_active_eq } \cs_set_eq:NN
+ \@@_tmp:nN { char_gset_active_eq } \cs_gset_eq:NN
\group_end:
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \begin{macrocode}
%<@@=peek>