summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/expl3/l3msg.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/expl3/l3msg.dtx')
-rw-r--r--Master/texmf-dist/source/latex/expl3/l3msg.dtx636
1 files changed, 328 insertions, 308 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3msg.dtx b/Master/texmf-dist/source/latex/expl3/l3msg.dtx
index a06612865a2..d3b33f44c55 100644
--- a/Master/texmf-dist/source/latex/expl3/l3msg.dtx
+++ b/Master/texmf-dist/source/latex/expl3/l3msg.dtx
@@ -37,7 +37,7 @@
\RequirePackage{l3names}
%</driver|package>
%\fi
-\GetIdInfo$Id: l3msg.dtx 1502 2009-09-01 16:23:32Z joseph $
+\GetIdInfo$Id: l3msg.dtx 1722 2009-11-06 13:22:12Z joseph $
{L3 Experimental LaTeX Messages module}
%\iffalse
%<*driver>
@@ -93,21 +93,19 @@
% output system.
%
%\begin{function}{
-% \msg_new:nnnnn|
% \msg_new:nnnn|
% \msg_new:nnn|
-% \msg_set:nnnnn|
% \msg_set:nnnn|
% \msg_set:nnn
%}
% \begin{syntax}
-% "\msg_new:nnnn" <module> <name> <text> <more text> <code>
+% "\msg_new:nnnn" \marg{module} \marg{name} \marg{text} \marg{more text}
% \end{syntax}
-% Creates new message <name> for <module> to produce <text> initially,
-% <more text> if requested by the user and to insert <code> after the
-% message when used as an error. <text> and <more text> can use up to
-% two macro parameters (|#1| and |#2|), which are supplied by the
-% message system. Inside <text> and <more text> spaces are not ignored.
+% Creates new message <name> for <module> to produce <text> initially
+% and <more text> if requested by the user. <text> and <more text> can
+% use up to four macro parameters (|#1| to |#4|), which are supplied by
+% the message system. Inside <text> and <more text> spaces are not
+% ignored.
%\end{function}
%
% \section{Message classes}
@@ -119,7 +117,7 @@
% \msg_class_set:nn
%}
% \begin{syntax}
-% "\msg_class_new:nn" <class> <code>
+% "\msg_class_new:nn" \marg{class} \marg{code}
% \end{syntax}
% Creates new <class> to output a message, using <code> to process
% the message text.
@@ -130,104 +128,126 @@
% the class or message is active.
%
%\begin{function}{
+% \msg_fatal:nnxxxx|
+% \msg_fatal:nnxxx|
% \msg_fatal:nnxx|
% \msg_fatal:nnx|
% \msg_fatal:nn
%}
% \begin{syntax}
-% "\msg_fatal:nnxx" <module> <name> <arg one> <arg two>
+% "\msg_fatal:nnxxxx" \marg{module} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Issues <module> error message <name>, passing <arg one> and
-% <arg two> to the text-creating functions. The \TeX\ run then halts.
+% Issues <module> error message <name>, passing <arg one> to
+% <arg four> to the text-creating functions. The \TeX\ run then halts.
%\end{function}
%
%\begin{function}{
+% \msg_error:nnxxxx|
+% \msg_error:nnxxx|
% \msg_error:nnxx|
% \msg_error:nnx|
% \msg_error:nn
%}
% \begin{syntax}
-% "\msg_error:nnxx" <module> <name> <arg one> <arg two>
+% "\msg_error:nnxxxx" \marg{module} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Issues <module> error message <name>, passing <arg one> and
-% <arg two> to the text-creating functions.
+% Issues <module> error message <name>, passing <arg one> to
+% <arg four> to the text-creating functions.
% \begin{texnote}
% The standard output here is similar to \cs{PackageError}.
% \end{texnote}
%\end{function}
%
%\begin{function}{
+% \msg_warning:nnxxxx|
+% \msg_warning:nnxxx|
% \msg_warning:nnxx|
% \msg_warning:nnx|
% \msg_warning:nn
%}
% \begin{syntax}
-% "\msg_warning:nnxx" <module> <name> <arg one> <arg two>
+% "\msg_warning:nnxxxx" \marg{module} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Prints <module> message <name> to the terminal, passing <arg one> and
-% <arg two> to the text-creating functions.
+% Prints <module> message <name> to the terminal, passing <arg one> to
+% <arg four> to the text-creating functions.
% \begin{texnote}
% The standard output here is similar to \cs{PackageWarningNoLine}.
% \end{texnote}
%\end{function}
%
%\begin{function}{
+% \msg_info:nnxxxx|
+% \msg_info:nnxxx|
% \msg_info:nnxx|
% \msg_info:nnx|
% \msg_info:nn
%}
% \begin{syntax}
-% "\msg_info:nnxx" <module> <name> <arg one> <arg two>
+% "\msg_info:nnxxxx" \marg{module} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Prints <module> message <name> to the log, passing <arg one> and
-% <arg two> to the text-creating functions.
+% Prints <module> message <name> to the log, passing <arg one> to
+% <arg four> to the text-creating functions.
% \begin{texnote}
% The standard output here is similar to \cs{PackageInfoNoLine}.
% \end{texnote}
%\end{function}
%
%\begin{function}{
+% \msg_log:nnxxxx|
+% \msg_log:nnxxx|
% \msg_log:nnxx|
% \msg_log:nnx|
% \msg_log:nn
%}
% \begin{syntax}
-% "\msg_info:nnxx" <module> <name> <arg one> <arg two>
+% "\msg_log:nnxxxx" \marg{module} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Prints <module> message <name> to the log, passing <arg one> and
-% <arg two> to the text-creating functions. No continuation text is
+% Prints <module> message <name> to the log, passing <arg one> to
+% <arg four> to the text-creating functions. No continuation text is
% added.
%\end{function}
%
%\begin{function}{
+% \msg_trace:nnxxxx|
+% \msg_trace:nnxxx|
% \msg_trace:nnxx|
% \msg_trace:nnx|
% \msg_trace:nn
%}
% \begin{syntax}
-% "\msg_info:nnxx" <module> <name> <arg one> <arg two>
+% "\msg_trace:nnxxxx" \marg{module} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Prints <module> message <name> to the log, passing <arg one> and
-% <arg two> to the text-creating functions. No continuation text is
+% Prints <module> message <name> to the log, passing <arg one> to
+% <arg four> to the text-creating functions. No continuation text is
% added.
%\end{function}
%
%\begin{function}{
+% \msg_none:nnxxxx|
+% \msg_none:nnxxx|
% \msg_none:nnxx|
% \msg_none:nnx|
% \msg_none:nn
%}
% \begin{syntax}
-% "\msg_none:nnxx" <module> <name> <arg one> <arg two>
+% "\msg_none:nnxxxx" \marg{module} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Does nothing: used for redirecting other message classes.
+% Does nothing: used for redirecting other message classes. Gobbles
+% arguments given.
%\end{function}
%
% \section{Redirecting messages}
%
%\begin{function}{\msg_redirect_class:nn}
% \begin{syntax}
-% "\msg_redirect_class:nn" <class one> <class two>
+% "\msg_redirect_class:nn" \marg{class one} \marg{class two}
% \end{syntax}
% Redirect all messages of <class one> to appear as those of
% <class two>.
@@ -235,7 +255,8 @@
%
%\begin{function}{\msg_redirect_module:nnn}
% \begin{syntax}
-% "\msg_redirect_module:nnn" <class one> <module> <class two>
+% "\msg_redirect_module:nnn" \marg{module} \marg{class one}
+% \marg{class two}
% \end{syntax}
% Redirect <module> messages of <class one> to appear in <class two>.
% \begin{texnote}
@@ -243,14 +264,14 @@
% default. For example, all of the \texttt{trace} messages of
% <module> could be turned off with:
% \begin{verbatim}
-% \msg_redirect_module:nnn { trace } { module } { none }
+% \msg_redirect_module:nnn { module } { trace } { none }
% \end{verbatim}
% \end{texnote}
%\end{function}
%
%\begin{function}{\msg_redirect_name:nnn}
% \begin{syntax}
-% "\msg_redirect_name:nnn" <module> <message> <class>
+% "\msg_redirect_name:nnn" \marg{module} \marg{message} \marg{class}
% \end{syntax}
% Redirect <module> <message> to appear using <class>.
%\end{function}
@@ -300,33 +321,30 @@
% respond to redirection.
%
%\begin{function}{
-% \msg_generic_new:nnnn|
% \msg_generic_new:nnn|
% \msg_generic_new:nn|
-% \msg_generic_set:nnnn|
% \msg_generic_set:nnn|
% \msg_generic_set:nn
%}
% \begin{syntax}
-% "\msg_generic_new:nnnn" <name> <text> <more text> <code>
+% "\msg_generic_new:nnn" \marg{name} \marg{text} \marg{more text}
% \end{syntax}
-% Creates new message <name> to produce <text> initially, <more text>
-% if requested by the user and to insert <code> after the message when
-% used as an error. <text> and <more text> can use up to two macro
-% parameters (|#1| and |#2|), which are supplied by the message system.
-% Inside <text> and <more text> spaces are not ignored.
+% Creates new message <name> to produce <text> initially and
+% <more text> if requested by the user. <text> and <more text> can use
+% up to four macro parameters (|#1| to |#4|), which are supplied by the
+% message system. Inside <text> and <more text> spaces are not ignored.
%\end{function}
%
-%\begin{function}{\msg_direct_interrupt:xxxxn}
+%\begin{function}{\msg_direct_interrupt:xxxx}
% \begin{syntax}
-% "\msg_direct_interrupt:xxxxn" <first line> <text>
-% ~~~~<continuation> <more text> <code>
+% "\msg_direct_interrupt:xxxxn" \marg{first line} \marg{text}
+% ~~~~\marg{continuation} \marg{more text}
% \end{syntax}
% Executes a \TeX\ error, interrupting compilation. The <first line>
% is displayed followed by <text> and the input prompt. <more text> is
-% displays if requested by the user, and <code> is inserted after the
-% message. If <more text> is blank a default is supplied. Each line of
-% <text> (broken with |\\|) begins with <continuation>.
+% displays if requested by the user. If <more text> is blank a default
+% is supplied. Each line of <text> (broken with |\\|) begins with
+% <continuation>.
%\end{function}
%
%\begin{function}{
@@ -334,7 +352,7 @@
% \msg_direct_term:xx
%}
% \begin{syntax}
-% "\msg_direct_log:xx" <text> <continuation>
+% "\msg_direct_log:xx" \marg{text} \marg{continuation}
% \end{syntax}
% Prints <text> to either the log or terminal. New lines (broken
% with |\\|) start with <continuation>.
@@ -345,73 +363,84 @@
%\begin{function}{
% \msg_kernel_new:nnnn|
% \msg_kernel_new:nnn|
-% \msg_kernel_new:nn|
% \msg_kernel_set:nnnn|
-% \msg_kernel_set:nnn|
-% \msg_kernel_set:nn
+% \msg_kernel_set:nnn
%}
% \begin{syntax}
-% "\msg_kernel_new:nnn" <name> <text> <more text> <code>
+% "\msg_kernel_new:nnnn" \marg{divsion} \marg{name} \marg{text}
+% ~~~~\marg{more text}
% \end{syntax}
-% Creates new kernel message <name> to produce <text> initially,
-% <more text> if requested by the user and to insert <code> after the
-% message when used as an error. <text> and <more text> can use up to
-% two macro parameters (|#1| and |#2|), which are supplied by the
-% message system.
+% Creates new kernel message <name> to produce <text> initially and
+% <more text> if requested by the user. <text> and <more text> can use
+% up to four macro parameters (|#1| to |#4|), which are supplied by the
+% message system. Kernel messages are divided into <divisions>, roughly
+% equivalent to the \LaTeXe\ package names used.
%\end{function}
%
%\begin{function}{
-% \msg_kernel_fatal:nxx|
-% \msg_kernel_fatal:nx|
-% \msg_kernel_fatal:n
+% \msg_kernel_fatal:nnxxxx|
+% \msg_kernel_fatal:nnxxx|
+% \msg_kernel_fatal:nnxx|
+% \msg_kernel_fatal:nnx|
+% \msg_kernel_fatal:nn
%}
% \begin{syntax}
-% "\msg_kernel_fatal:nxx" <name> <arg one> <arg two>
+% "\msg_kernel_fatal:nnxx" \marg{division} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Issues kernel error message <name>, passing <arg one> and
-% <arg two> to the text-creating functions. The \TeX\ run then halts.
-% Cannot be redirected.
+% Issues kernel error message <name> for <division>, passing <arg one>
+% to <arg four> to the text-creating functions. The \TeX\ run then
+% halts. Cannot be redirected.
%\end{function}
%
%\begin{function}{
-% \msg_kernel_error:nxx|
-% \msg_kernel_error:nx|
-% \msg_kernel_error:n
+% \msg_kernel_error:nnxxxx|
+% \msg_kernel_error:nnxxx|
+% \msg_kernel_error:nnxx|
+% \msg_kernel_error:nnx|
+% \msg_kernel_error:nn
%}
% \begin{syntax}
-% "\msg_kernel_error:nxx" <name> <arg one> <arg two>
+% "\msg_kernel_error:nnxx" \marg{division} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Issues kernel error message <name>, passing <arg one> and
-% <arg two> to the text-creating functions. Cannot be redirected.
+% Issues kernel error message <name> for <division>, passing <arg one>
+% to <arg four> to the text-creating functions. Cannot be redirected.
%\end{function}
%
%\begin{function}{
-% \msg_kernel_warning:nxx|
-% \msg_kernel_warning:nx|
-% \msg_kernel_warning:n
+% \msg_kernel_warning:nnxxxx|
+% \msg_kernel_warning:nnxxx|
+% \msg_kernel_warning:nnxx|
+% \msg_kernel_warning:nnx|
+% \msg_kernel_warning:nn
%}
% \begin{syntax}
-% "\msg_kernel_warning:nxx" <name> <arg one> <arg two>
+% "\msg_kernel_warning:nnxx" \marg{division} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Prints kernel message <name> to the terminal, passing <arg one> and
-% <arg two> to the text-creating functions.
+% Prints kernel message <name> for <division> to the terminal, passing
+% <arg one> to <arg four> to the text-creating functions.
%\end{function}
%
%\begin{function}{
-% \msg_kernel_info:nxx|
-% \msg_kernel_info:nx|
-% \msg_kernel_info:n
+% \msg_kernel_info:nnxxxx|
+% \msg_kernel_info:nnxxx|
+% \msg_kernel_info:nnxx|
+% \msg_kernel_info:nnx|
+% \msg_kernel_info:nn
%}
% \begin{syntax}
-% "\msg_kernel_info:nxx" <name> <arg one> <arg two>
+% "\msg_kernel_info:nxx" \marg{division} \marg{name} \marg{arg one}
+% ~~~~\marg{arg two} \marg{arg three} \marg{arg four}
% \end{syntax}
-% Prints kernel message <name> to the log, passing <arg one> and
-% <arg two> to the text-creating functions.
+% Prints kernel message <name> for <division> to the log, passing
+% <arg one> to <arg four> to the text-creating functions.
%\end{function}
%
%\begin{function}{\msg_kernel_bug:x}
% \begin{syntax}
-% "\msg_kernel_bug:x" <text>
+% "\msg_kernel_bug:x" \marg{text}
% \end{syntax}
% Short-cut for ``This is a LaTeX bug: check coding'' errors.
%\end{function}
@@ -446,7 +475,6 @@
%\begin{variable}{
% \c_msg_text_prefix_tl|
% \c_msg_more_text_prefix_tl|
-% \c_msg_code_prefix_tl
%}
% Header information for storing the ``paths'' to parts of a message.
%\end{variable}
@@ -573,7 +601,7 @@
%\end{macro}
%
%\begin{macro}{\c_msg_on_line_tl}
-% ``On line''.
+% Text for ``on line''.
% \begin{macrocode}
\tl_new:Nn \c_msg_on_line_tl { on~line }
% \end{macrocode}
@@ -581,16 +609,13 @@
%
%\begin{macro}{\c_msg_text_prefix_tl}
%\begin{macro}{\c_msg_more_text_prefix_tl}
-%\begin{macro}{\c_msg_code_prefix_tl}
% Prefixes for storage areas.
% \begin{macrocode}
\tl_new:Nn \c_msg_text_prefix_tl { msg_text ~>~ }
\tl_new:Nn \c_msg_more_text_prefix_tl { msg_text_more ~>~ }
-\tl_new:Nn \c_msg_code_prefix_tl { msg_code ~>~ }
% \end{macrocode}
%\end{macro}
%\end{macro}
-%\end{macro}
%
%\begin{macro}{\l_msg_class_tl}
%\begin{macro}{\l_msg_current_class_tl}
@@ -632,11 +657,10 @@
%\begin{macro}{\msg_line_context:}
% For writing the line number nicely.
% \begin{macrocode}
-\cs_new_nopar:Nn { \msg_line_number: } {
+\cs_new_nopar:Npn \msg_line_number: {
\toks_use:N \tex_inputlineno:D
}
-\cs_new_nopar:Nn { \msg_line_context: } {
- \msg_space:
+\cs_new_nopar:Npn \msg_line_context: {
\c_msg_on_line_tl
\msg_space:
\msg_line_number:
@@ -649,8 +673,8 @@
%\begin{macro}{\msg_two_newlines:}
% Always forces a new line.
% \begin{macrocode}
-\cs_new_nopar:Nn \msg_newline: { ^^J }
-\cs_new_nopar:Nn \msg_two_newlines: { ^^J ^^J }
+\cs_new_nopar:Npn \msg_newline: { ^^J }
+\cs_new_nopar:Npn \msg_two_newlines: { ^^J ^^J }
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -660,9 +684,11 @@
%\begin{macro}{\msg_four_spaces:}
% For printing spaces, some very simple functions.
% \begin{macrocode}
-\cs_new_nopar:Nn \msg_space: { ~ }
-\cs_new_nopar:Nn \msg_two_spaces: { \msg_space: \msg_space: }
-\cs_new_nopar:Nn \msg_four_spaces: { \msg_two_spaces: \msg_two_spaces: }
+\cs_new_nopar:Npn \msg_space: { ~ }
+\cs_new_nopar:Npn \msg_two_spaces: { \msg_space: \msg_space: }
+\cs_new_nopar:Npn \msg_four_spaces: {
+ \msg_two_spaces: \msg_two_spaces:
+}
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -673,91 +699,55 @@
% The lowest level functions make no assumptions about modules,
% \emph{etc.}
%
-%\begin{macro}{\msg_generic_new:nnnn}
%\begin{macro}{\msg_generic_new:nnn}
%\begin{macro}{\msg_generic_new:nn}
% Creating a new message is basically the same as the non-checking
% version, and so after a check everything hands over.
% \begin{macrocode}
-\cs_new_nopar:Npn \msg_generic_new:nnnn #1 {
- \exp_args:Nc \chk_if_free_cs:N { \c_msg_text_prefix_tl #1 :nn }
- \msg_generic_set:nnnn {#1}
-}
\cs_new_nopar:Npn \msg_generic_new:nnn #1 {
- \exp_args:Nc \chk_if_free_cs:N { \c_msg_text_prefix_tl #1 :nn }
+ \chk_if_free_cs:c { \c_msg_text_prefix_tl #1 :xxxx }
\msg_generic_set:nnn {#1}
}
\cs_new_nopar:Npn \msg_generic_new:nn #1 {
- \exp_args:Nc \chk_if_free_cs:N { \c_msg_text_prefix_tl #1 :nn }
+ \chk_if_free_cs:c { \c_msg_text_prefix_tl #1 :xxxx }
\msg_generic_set:nn {#1}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
-%\end{macro}
%
-%\begin{macro}{\msg_generic_set:nnnn}
%\begin{macro}{\msg_generic_set:nnn}
%\begin{macro}{\msg_generic_set:nn}
%\begin{macro}[aux]{\msg_generic_set_clist:n}
%\begin{macro}[aux]{\msg_generic_set_text:n}
%\begin{macro}[aux]{\msg_generic_set_more_text:n}
-%\begin{macro}[aux]{\msg_generic_set_code:n}
% Creating a message is quite simple. There must be a short text part,
-% while the other parts may not exist. To avoid filling up the hash
-% table with empty functions,only non-empty arguments are stored.
-% The various auxiliary functions are used to allow spaces in the
-% text arguments.
+% while the longer text may or may not be available.
% \begin{macrocode}
-\cs_new_nopar:Npn \msg_generic_set:nnnn #1 {
- \msg_generic_set_clist:n {#1}
- \char_make_space:N \ %
- \msg_generic_set_code:nnnn{#1}%
-}
\cs_new_nopar:Npn \msg_generic_set:nnn #1 {
\msg_generic_set_clist:n {#1}
- \char_make_space:N \ %
- \msg_generic_set_more_text:nnn{#1}%
+ \char_make_space:N \
+ \msg_generic_set_more_text:nnn {#1}
}
\cs_new_nopar:Npn \msg_generic_set:nn #1 {
\msg_generic_set_clist:n {#1}
- \char_make_space:N \ %
- \msg_generic_set_text:nn{#1}%
+ \char_make_space:N \
+ \msg_generic_set_text:nn {#1}
}
\cs_new_nopar:Npn \msg_generic_set_clist:n #1 {
\clist_if_in:NnF \l_msg_names_clist { // #1 / } {
\clist_put_right:Nn \l_msg_names_clist { // #1 / }
}
}
-\cs_new:Nn \msg_generic_set_text:nn {
- \cs_set:cn { \c_msg_text_prefix_tl #1 :nn } {#2}
+\cs_new:Npn \msg_generic_set_text:nn #1#2 {
+ \cs_set:cpn { \c_msg_text_prefix_tl #1 :xxxx } ##1##2##3##4 {#2}
+ \cs_set_eq:cN { \c_msg_more_text_prefix_tl #1 :xxxx } \c_undefined
\char_make_ignore:N \
}
-\cs_new:Nn \msg_generic_set_more_text:nnn {
- \cs_set:cn { \c_msg_text_prefix_tl #1 :nn } {#2}
- \tl_if_empty:nTF {#3} {
- \cs_set_eq:cN { \c_msg_more_text_prefix_tl #1 } \c_undefined
- }{
- \cs_set:cn { \c_msg_more_text_prefix_tl #1 :nn } {#3}
- }
- \char_make_ignore:N \
-}
-\cs_new:Npn \msg_generic_set_code:nnnn #1#2#3 {
- \cs_set:cn { \c_msg_text_prefix_tl #1 :nn } {#2}
- \tl_if_empty:nTF {#3} {
- \cs_set_eq:cN { \c_msg_more_text_prefix_tl #1 } \c_undefined
- }{
- \cs_set:cn { \c_msg_more_text_prefix_tl #1 :nn } {#3}
- }
+\cs_new:Npn \msg_generic_set_more_text:nnn #1#2#3 {
+ \cs_set:cpn { \c_msg_text_prefix_tl #1 :xxxx } ##1##2##3##4 {#2}
+ \cs_set:cpn { \c_msg_more_text_prefix_tl #1 :xxxx } ##1##2##3##4 {#3}
\char_make_ignore:N \
- \msg_generic_set_code:nn {#1}
-}
-\cs_new:Nn \msg_generic_set_code:nn {
- \tl_if_empty:nTF {#2} {
- \cs_set_eq:cN { \c_msg_code_prefix_tl #1 : } \c_undefined
- }{
- \cs_set:cn { \c_msg_code_prefix_tl #1 : } {#2}
- }
}
% \end{macrocode}
%\end{macro}
@@ -765,19 +755,17 @@
%\end{macro}
%\end{macro}
%\end{macro}
-%\end{macro}
-%\end{macro}
%
-%\begin{macro}{\msg_direct_interrupt:xxxxn}
+%\begin{macro}{\msg_direct_interrupt:xxxx}
%\begin{macro}[aux]{\msg_direct_interrupt:n}
% The low-level interruption macro is rather opaque, unfortunately. The
% idea here is to create a a message which hides all of \TeX's own
% information by filling the output up with spaces. To achieve this,
% spaces have to be letters: hence no indentation. The odd
-% \cs{c_msg_hide_tl} actually does the hiding: it is the large run of
-% spaces in the name that is important here. The meaning of |\\|
-% is altered so that the explanation text is a simple run whilst the
-% initial error has line-continuation shown.
+% \cs{c_msg_hide_tl<spaces>} actually does the hiding: it is the
+% large run of spaces in the name that is important here. The meaning
+% of |\\| is altered so that the explanation text is a simple run
+% whilst the initial error has line-continuation shown.
% \begin{macrocode}
\group_begin:
\char_set_lccode:nn {`\&} {`\ } % {
@@ -786,7 +774,7 @@
\char_make_letter:N\ %
\tl_to_lowercase:n{%
\group_end:%
-\cs_new_protected:Nn\msg_direct_interrupt:xxxxn{%
+\cs_new_protected:Npn\msg_direct_interrupt:xxxx#1#2#3#4{%
\group_begin:%
\cs_set_eq:NN\\\msg_newline:%
\cs_set_eq:NN\ \msg_space:%
@@ -803,14 +791,13 @@
}%
&%
\group_end:%
-#5%
}%
}%
-\cs_new:Nn \msg_direct_interrupt_aux:n {
+\cs_new:Npn \msg_direct_interrupt_aux:n #1 {
\tl_if_empty:nTF {#1} {
\tl_set:Nx \l_msg_tmp_tl { { \c_msg_no_info_text_tl } }
}{
- \tl_set:Nx \l_msg_tmp_tl { {#1 } }
+ \tl_set:Nx \l_msg_tmp_tl { {#1} }
}
}
% \end{macrocode}
@@ -821,14 +808,14 @@
%\begin{macro}{\msg_direct_term:xx}
% Printing to the log or terminal without a stop is rather easier.
% \begin{macrocode}
-\cs_new_protected:Nn \msg_direct_log:xx {
+\cs_new_protected:Npn \msg_direct_log:xx #1#2 {
\group_begin:
\cs_set:Npn \\ { \msg_newline: #2 }
\cs_set_eq:NN \ \msg_space:
\iow_log:x { #1 \msg_newline: }
\group_end:
}
-\cs_new_protected:Nn \msg_direct_term:xx {
+\cs_new_protected:Npn \msg_direct_term:xx #1#2 {
\group_begin:
\cs_set:Npn \\ { \msg_newline: #2 }
\cs_set_eq:NN \ \msg_space:
@@ -845,26 +832,18 @@
% module from the message name. These have short names as they will be
% widely used.
%
-%\begin{macro}{\msg_new:nnnnn}
%\begin{macro}{\msg_new:nnnn}
%\begin{macro}{\msg_new:nnn}
-%\begin{macro}{\msg_set:nnnnn}
%\begin{macro}{\msg_set:nnnn}
%\begin{macro}{\msg_set:nnn}
-% For making messages.
+% For making messages: all aliases.
% \begin{macrocode}
-\cs_new_nopar:Npn \msg_new:nnnnn #1#2 {
- \msg_generic_new:nnnn { #1 / #2 }
-}
\cs_new_nopar:Npn \msg_new:nnnn #1#2 {
\msg_generic_new:nnn { #1 / #2 }
}
\cs_new_nopar:Npn \msg_new:nnn #1#2 {
\msg_generic_new:nn { #1 / #2 }
}
-\cs_new_nopar:Npn \msg_set:nnnnn #1#2 {
- \msg_generic_set:nnnn { #1 / #2 }
-}
\cs_new_nopar:Npn \msg_set:nnnn #1#2 {
\msg_generic_set:nnn { #1 / #2 }
}
@@ -873,8 +852,6 @@
}
% \end{macrocode}
%\end{macro}
-%\end{macro}
-%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
@@ -886,63 +863,70 @@
% so that redirection will work as desired.
% \begin{macrocode}
\cs_new_nopar:Npn \msg_class_new:nn #1 {
- \exp_args:Nc \chk_if_free_cs:N { msg_ #1 :nnxx }
+ \chk_if_free_cs:c { msg_ #1 :nnxxxx }
\prop_new:c { l_msg_redirect_ #1 _prop }
\msg_class_set:nn {#1}
}
-\cs_new_nopar:Nn \msg_class_set:nn {
+\cs_new_nopar:Npn \msg_class_set:nn #1#2 {
\prop_clear:c { l_msg_redirect_ #1 _prop }
- \cs_set_protected:cn { msg_ #1 :nnxx } {
- \msg_use:nnnnxx {#1} {#2} {##1} {##2} {##3} {##4}
+ \cs_set_protected:cpn { msg_ #1 :nnxxxx } ##1##2##3##4##5##6 {
+ \msg_use:nnnnxxxx {#1} {#2} {##1} {##2} {##3} {##4} {##5} {##6}
+ }
+ \cs_set_protected:cpx { msg_ #1 :nnxxx } ##1##2##3##4##5 {
+ \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { }
}
- \cs_set_protected:cn { msg_ #1 :nnx } {
- \use:c { msg_ #1 :nnxx } {##1} {##2} {##3} { }
+ \cs_set_protected:cpx { msg_ #1 :nnxx } ##1##2##3##4 {
+ \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { }
}
- \cs_set_protected:cn { msg_ #1 :nn } {
- \use:c { msg_ #1 :nnxx } {##1} {##2} { } { }
+ \cs_set_protected:cpx { msg_ #1 :nnx } ##1##2##3 {
+ \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { }
+ }
+ \cs_set_protected:cpx { msg_ #1 :nn } ##1##2 {
+ \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} { } { } { } { }
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%
-%\begin{macro}[aux]{\msg_use:nnnnxx}
+%\begin{macro}[aux]{\msg_use:nnnnxxxx}
% The main message-using macro creates two auxiliary functions: one
% containing the code for the message, and the second a loop function.
% There is then a hand-off to the system for checking if redirection is
% needed.
% \begin{macrocode}
-\cs_new:Nn \msg_use:nnnnxx {
- \cs_set:Nn \msg_use_code: {
+\cs_new:Npn \msg_use:nnnnxxxx #1#2#3#4#5#6#7#8 {
+ \cs_set_nopar:Npn \msg_use_code: {
\clist_clear:N \l_msg_redirect_classes_clist
#2
}
- \cs_set:Nn \msg_use_loop:n {
+ \cs_set:Npn \msg_use_loop:n ##1 {
\clist_if_in:NnTF \l_msg_redirect_classes_clist {#1} {
- \msg_kernel_error:n { message-loop }
+ \msg_kernel_error:nn { msg } { redirect-loop } {#1}
}{
\clist_put_right:Nn \l_msg_redirect_classes_clist {#1}
- \cs_if_exist:cTF { msg_ ##1 :nnxx } {
- \use:c { msg_ ##1 :nnxx } {#3} {#4} {#5} {#6}
+ \cs_if_exist:cTF { msg_ ##1 :nnxxxx } {
+ \use:c { msg_ ##1 :nnxxxx } {#3} {#4} {#5} {#6} {#7} {#8}
}{
- \msg_kernel_error:nx { message-class-unknown } { ##1 }
+ \msg_kernel_error:nnx { msg } { message-class-unknown } {##1}
}
}
}
- \cs_if_exist:cTF { \c_msg_text_prefix_tl #3 / #4 :nn } {
+ \cs_if_exist:cTF { \c_msg_text_prefix_tl #3 / #4 :xxxx } {
\msg_use_aux:nnn {#1} {#3} {#4}
}{
- \msg_kernel_error:nxx { message-unknown } { #3 } { #4 }
+ \msg_kernel_error:nnxx { msg } { message-unknown } {#3} {#4}
}
}
% \end{macrocode}
%\end{macro}
+%
%\begin{macro}[aux]{\msg_use_code:}
%\begin{macro}[aux]{\msg_use_loop:}
% Blank definitions are initially created for these functions.
% \begin{macrocode}
-\cs_new_nopar:Nn \msg_use_code: { }
-\cs_new_nopar:Nn \msg_use_loop:n { }
+\cs_new_nopar:Npn \msg_use_code: { }
+\cs_new:Npn \msg_use_loop:n #1 { }
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -951,7 +935,7 @@
% The first auxiliary macro looks for a match by name: the most
% restrictive check.
% \begin{macrocode}
-\cs_new_nopar:Nn \msg_use_aux:nnn {
+\cs_new_nopar:Npn \msg_use_aux:nnn #1#2#3 {
\tl_set:Nn \l_msg_current_class_tl {#1}
\tl_set:Nn \l_msg_current_module_tl {#2}
\prop_if_in:NnTF \l_msg_redirect_names_prop { // #2 / #3 / } {
@@ -966,12 +950,12 @@
% The second function checks for general matches by module or for
% all modules.
% \begin{macrocode}
-\cs_new_nopar:Nn \msg_use_aux:nn {
+\cs_new_nopar:Npn \msg_use_aux:nn #1#2 {
\prop_if_in:cnTF { l_msg_redirect_ #1 _prop } {#2} {
\msg_use_loop_check:nn {#1} {#2}
}{
- \prop_if_in:cnTF { l_msg_redirect_ #1 _prop } {*} {
- \msg_use_loop_check:nn {#1} {*}
+ \prop_if_in:cnTF { l_msg_redirect_ #1 _prop } { * } {
+ \msg_use_loop_check:nn {#1} { * }
}{
\msg_use_code:
}
@@ -983,7 +967,7 @@
% When checking whether to loop, the same code is needed in a few
% places.
% \begin{macrocode}
-\cs_new:Nn \msg_use_loop_check:nn {
+\cs_new:Npn \msg_use_loop_check:nn #1#2 {
\prop_get:cnN { l_msg_redirect_ #1 _prop } {#2} \l_msg_class_tl
\tl_if_eq:NNTF \l_msg_current_class_tl \l_msg_class_tl {
\msg_use_code:
@@ -994,27 +978,33 @@
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\msg_fatal:nnxxxx}
+%\begin{macro}{\msg_fatal:nnxxx}
%\begin{macro}{\msg_fatal:nnxx}
%\begin{macro}{\msg_fatal:nnx}
%\begin{macro}{\msg_fatal:nn}
% For fatal errors, after the error message \TeX\ bails out.
% \begin{macrocode}
\msg_class_new:nn { fatal } {
- \msg_direct_interrupt:xxxxn
+ \msg_direct_interrupt:xxxx
{ \c_msg_fatal_tl \msg_two_newlines: }
{
( \c_msg_fatal_tl ) \msg_space:
- \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4}
+ \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6}
}
{ ( \c_msg_fatal_tl ) \msg_space: }
{ \c_msg_fatal_text_tl }
- { \tex_end:D }
+ \tex_end:D
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
+%\begin{macro}{\msg_error:nnxxxx}
+%\begin{macro}{\msg_error:nnxxx}
%\begin{macro}{\msg_error:nnxx}
%\begin{macro}{\msg_error:nnx}
%\begin{macro}{\msg_error:nn}
@@ -1022,31 +1012,31 @@
% is tried.
% \begin{macrocode}
\msg_class_new:nn { error } {
- \msg_direct_interrupt:xxxxn
+ \msg_direct_interrupt:xxxx
{ #1~\c_msg_error_tl \msg_newline: }
{
( #1 ) \msg_space:
- \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4}
+ \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6}
}
{ ( #1 ) \msg_space: }
{
- \cs_if_exist:cTF { \c_msg_more_text_prefix_tl #1 / #2 :nn } {
- \use:c { \c_msg_more_text_prefix_tl #1 / #2 :nn } {#3} {#4}
- }{
- \c_msg_no_info_text_tl
- }
- }
- {
- \cs_if_exist:cT { \c_msg_code_prefix_tl #1 /#2 :nn } {
- \use:c { \c_msg_code_prefix_tl #1 / #2 :nn} {#3} {#4}
- }
+ \cs_if_exist:cTF { \c_msg_more_text_prefix_tl #1 / #2 :xxxx }
+ {
+ \use:c { \c_msg_more_text_prefix_tl #1 / #2 :xxxx }
+ {#3} {#4} {#5} {#6}
+ }
+ { \c_msg_no_info_text_tl }
}
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
+%\begin{macro}{\msg_warning:nnxxxx}
+%\begin{macro}{\msg_warning:nnxxx}
%\begin{macro}{\msg_warning:nnxx}
%\begin{macro}{\msg_warning:nnx}
%\begin{macro}{\msg_warning:nn}
@@ -1054,8 +1044,8 @@
% \begin{macrocode}
\msg_class_new:nn { warning } {
\msg_direct_term:xx {
- \msg_space: #1~\c_msg_warning_tl :~
- \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4}
+ \msg_space: #1 ~ \c_msg_warning_tl :~
+ \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6}
}
{ ( #1 ) \msg_two_spaces: }
}
@@ -1063,7 +1053,11 @@
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
+%\begin{macro}{\msg_info:nnxxxx}
+%\begin{macro}{\msg_info:nnxxx}
%\begin{macro}{\msg_info:nnxx}
%\begin{macro}{\msg_info:nnx}
%\begin{macro}{\msg_info:nn}
@@ -1072,7 +1066,7 @@
\msg_class_new:nn { info } {
\msg_direct_log:xx {
\msg_space: #1~\c_msg_info_tl :~
- \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4}
+ \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6}
}
{ ( #1 ) \msg_two_spaces: }
}
@@ -1080,7 +1074,11 @@
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
+%\begin{macro}{\msg_log:nnxxxx}
+%\begin{macro}{\msg_log:nnxxx}
%\begin{macro}{\msg_log:nnxx}
%\begin{macro}{\msg_log:nnx}
%\begin{macro}{\msg_log:nn}
@@ -1089,7 +1087,7 @@
% \begin{macrocode}
\msg_class_new:nn { log } {
\msg_direct_log:xx {
- \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4}
+ \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6}
}
{ }
}
@@ -1097,7 +1095,11 @@
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
+%\begin{macro}{\msg_trace:nnxxxx}
+%\begin{macro}{\msg_trace:nnxxx}
%\begin{macro}{\msg_trace:nnxx}
%\begin{macro}{\msg_trace:nnx}
%\begin{macro}{\msg_trace:nn}
@@ -1105,7 +1107,7 @@
% \begin{macrocode}
\msg_class_new:nn { trace } {
\msg_direct_log:xx {
- \use:c { \c_msg_text_prefix_tl #1 / #2 :nn } {#3} {#4}
+ \use:c { \c_msg_text_prefix_tl #1 / #2 :xxxx } {#3} {#4} {#5} {#6}
}
{ }
}
@@ -1113,7 +1115,11 @@
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
+%\begin{macro}{\msg_none:nnxxxx}
+%\begin{macro}{\msg_none:nnxxx}
%\begin{macro}{\msg_none:nnxx}
%\begin{macro}{\msg_none:nnx}
%\begin{macro}{\msg_none:nn}
@@ -1124,14 +1130,16 @@
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
%\subsection{Redirection functions}
%
%\begin{macro}{\msg_redirect_class:nn}
% Converts class one into class two.
% \begin{macrocode}
-\cs_new_nopar:Nn \msg_redirect_class:nn {
- \prop_put:cnn { l_msg_redirect_ #1 _prop } {*} {#2}
+\cs_new_nopar:Npn \msg_redirect_class:nn #1#2 {
+ \prop_put:cnn { l_msg_redirect_ #1 _prop } { * } {#2}
}
% \end{macrocode}
%\end{macro}
@@ -1139,7 +1147,7 @@
%\begin{macro}{\msg_redirect_module:nnn}
% For when all messages of a class should be altered for a given module.
% \begin{macrocode}
-\cs_new_nopar:Nn \msg_redirect_module:nnn {
+\cs_new_nopar:Npn \msg_redirect_module:nnn #1#2#3 {
\prop_put:cnn { l_msg_redirect_ #2 _prop } {#1} {#3}
}
% \end{macrocode}
@@ -1148,7 +1156,7 @@
%\begin{macro}{\msg_redirect_name:nnn}
% Named message will always use the given class.
% \begin{macrocode}
-\cs_new_nopar:Nn \msg_redirect_name:nnn {
+\cs_new_nopar:Npn \msg_redirect_name:nnn #1#2#3 {
\prop_put:Nnn \l_msg_redirect_names_prop { // #1 / #2 / } {#3}
}
% \end{macrocode}
@@ -1158,100 +1166,107 @@
%
%\begin{macro}{\msg_kernel_new:nnnn}
%\begin{macro}{\msg_kernel_new:nnn}
-%\begin{macro}{\msg_kernel_new:nn}
%\begin{macro}{\msg_kernel_set:nnnn}
%\begin{macro}{\msg_kernel_set:nnn}
-%\begin{macro}{\msg_kernel_set:nn}
% The kernel needs some messages of its own. These are created using
% pre-built functions. Two functions are provided: one more general
% and one which only has the short text part.
% \begin{macrocode}
-\cs_new_nopar:Npn \msg_kernel_new:nnnn #1 {
- \msg_new:nnnnn { LaTeX } {#1}
-}
-\cs_new_nopar:Npn \msg_kernel_new:nnn #1 {
- \msg_new:nnnn { LaTeX } {#1}
+\cs_new_nopar:Npn \msg_kernel_new:nnnn #1#2 {
+ \msg_new:nnnn { LaTeX } { #1 / #2 }
}
-\cs_new_nopar:Npn \msg_kernel_new:nn #1 {
- \msg_new:nnn { LaTeX } {#1}
+\cs_new_nopar:Npn \msg_kernel_new:nnn #1#2 {
+ \msg_new:nnn { LaTeX } { #1 / #2 }
}
-\cs_new_nopar:Npn \msg_kernel_set:nnnn #1 {
- \msg_set:nnnnn { LaTeX } {#1}
+\cs_new_nopar:Npn \msg_kernel_set:nnnn #1#2 {
+ \msg_set:nnnn { LaTeX } { #1 / #2 }
}
-\cs_new_nopar:Npn \msg_kernel_set:nnn #1 {
- \msg_set:nnnn { LaTeX } {#1}
-}
-\cs_new_nopar:Npn \msg_kernel_set:nn #1 {
- \msg_set:nnn { LaTeX } {#1}
+\cs_new_nopar:Npn \msg_kernel_set:nnn #1#2 {
+ \msg_set:nnn { LaTeX } { #1 / #2 }
}
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
-%\end{macro}
-%\end{macro}
%
%\begin{macro}[aux]{\msg_kernel_classes_new:n}
% Quickly make the fewer-arguments versions.
% \begin{macrocode}
-\cs_new_nopar:Nn \msg_kernel_classes_new:n {
- \cs_new_protected:cn { msg_kernel_ #1 :nx } {
- \use:c { msg_kernel_ #1 :nxx } {##1} {##2} { }
+\cs_new_nopar:Npn \msg_kernel_classes_new:n #1 {
+ \cs_new_protected:cpx { msg_kernel_ #1 :nnxxx } ##1##2##3##4##5
+ {
+ \exp_not:c { msg_kernel_ #1 :nnxxxx }
+ {##1} {##2} {##3} {##4} {##5} { }
+ }
+ \cs_new_protected:cpx { msg_kernel_ #1 :nnxx } ##1##2##3##4
+ {
+ \exp_not:c { msg_kernel_ #1 :nnxxxx }
+ {##1} {##2} {##3} {##4} { } { }
}
- \cs_new_protected:cn { msg_kernel_ #1 :n } {
- \use:c { msg_kernel_ #1 :nxx } {##1} { } { }
+ \cs_new_protected:cpx { msg_kernel_ #1 :nnx } ##1##2##3
+ {
+ \exp_not:c { msg_kernel_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { }
+ }
+ \cs_new_protected:cpx { msg_kernel_ #1 :nn } ##1##2
+ {
+ \exp_not:c { msg_kernel_ #1 :nnxxxx } {##1} {##2} { } { } { } { }
}
}
% \end{macrocode}
%\end{macro}
%
-%\begin{macro}{\msg_kernel_fatal:nxx}
-%\begin{macro}{\msg_kernel_fatal:nx}
-%\begin{macro}{\msg_kernel_fatal:n}
+%\begin{macro}{\msg_kernel_fatal:nnxxxx}
+%\begin{macro}{\msg_kernel_fatal:nnxxx}
+%\begin{macro}{\msg_kernel_fatal:nnxx}
+%\begin{macro}{\msg_kernel_fatal:nnx}
+%\begin{macro}{\msg_kernel_fatal:nn}
% Fatal kernel errors cannot be re-defined.
% \begin{macrocode}
-\cs_new_protected:Nn \msg_kernel_fatal:nxx {
- \msg_direct_interrupt:xxxxn
+\cs_new_protected:Npn \msg_kernel_fatal:nnxxxx #1#2#3#4#5#6 {
+ \msg_direct_interrupt:xxxx
{ \c_msg_fatal_tl \msg_two_newlines: }
{
( LaTeX ) \msg_space:
- \use:c { \c_msg_text_prefix_tl LaTeX / #1 :nn } {#2} {#3}
+ \use:c { \c_msg_text_prefix_tl LaTeX / #1 / #2 :xxxx }
+ {#3} {#4} {#5} {#6}
}
{ ( LaTeX ) \msg_space: }
{ \c_msg_fatal_text_tl }
- { \tex_end:D }
+ \tex_end:D
}
\msg_kernel_classes_new:n { fatal }
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
-%\begin{macro}{\msg_kernel_error:nxx}
-%\begin{macro}{\msg_kernel_error:nx}
-%\begin{macro}{\msg_kernel_error:n}
+%\begin{macro}{\msg_kernel_error:nnxxxx}
+%\begin{macro}{\msg_kernel_error:nnxxx}
+%\begin{macro}{\msg_kernel_error:nnxx}
+%\begin{macro}{\msg_kernel_error:nnx}
+%\begin{macro}{\msg_kernel_error:nn}
% Neither can kernel errors.
% \begin{macrocode}
-\cs_new_protected:Nn \msg_kernel_error:nxx {
- \msg_direct_interrupt:xxxxn
+\cs_new_protected:Npn \msg_kernel_error:nnxxxx #1#2#3#4#5#6 {
+ \msg_direct_interrupt:xxxx
{ LaTeX~\c_msg_error_tl \msg_newline: }
{
( LaTeX ) \msg_space:
- \use:c { \c_msg_text_prefix_tl LaTeX / #1 :nn } {#2} {#3}
+ \use:c { \c_msg_text_prefix_tl LaTeX / #1 / #2 :xxxx }
+ {#3} {#4} {#5} {#6}
}
{ ( LaTeX ) \msg_space: }
{
- \cs_if_exist:cTF { \c_msg_more_text_prefix_tl LaTeX / #1 :nn } {
- \use:c { \c_msg_more_text_prefix_tl LaTeX / #1 :nn } {#2} {#3}
- }{
- \c_msg_no_info_text_tl
- }
- }
- {
- \cs_if_exist:cT { \c_msg_code_prefix_tl LaTeX /#1 :nn } {
- \use:c { \c_msg_code_prefix_tl LaTeX / #1 :nn} {#2} {#3}
- }
+ \cs_if_exist:cTF
+ { \c_msg_more_text_prefix_tl LaTeX / #1 / #2 :xxxx }
+ {
+ \use:c { \c_msg_more_text_prefix_tl LaTeX / #1 / #2 :xxxx }
+ {#3} {#4} {#5} {#6}
+ }
+ { \c_msg_no_info_text_tl }
}
}
\msg_kernel_classes_new:n { error }
@@ -1259,22 +1274,28 @@
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
%
-%\begin{macro}{\msg_kernel_warning:nxx}
-%\begin{macro}{\msg_kernel_warning:nx}
-%\begin{macro}{\msg_kernel_warning:n}
-%\begin{macro}{\msg_kernel_info:nxx}
-%\begin{macro}{\msg_kernel_info:nx}
-%\begin{macro}{\msg_kernel_info:n}
+%\begin{macro}{\msg_kernel_warning:nnxxxx}
+%\begin{macro}{\msg_kernel_warning:nnxxx}
+%\begin{macro}{\msg_kernel_warning:nnxx}
+%\begin{macro}{\msg_kernel_warning:nnx}
+%\begin{macro}{\msg_kernel_warning:nn}
+%\begin{macro}{\msg_kernel_info:nnxxxx}
+%\begin{macro}{\msg_kernel_info:nnxxx}
+%\begin{macro}{\msg_kernel_info:nnxx}
+%\begin{macro}{\msg_kernel_info:nnx}
+%\begin{macro}{\msg_kernel_info:nn}
% Life is much more simple for warnings and information messages, as
% these are just short-cuts to the standard classes.
% \begin{macrocode}
-\cs_new_protected_nopar:Npn \msg_kernel_warning:nxx {
- \msg_warning:nnxx { LaTeX }
+\cs_new_protected_nopar:Npn \msg_kernel_warning:nnxxxx #1#2 {
+ \msg_warning:nnxxxx { LaTeX } { #1 / #2 }
}
\msg_kernel_classes_new:n { warning }
-\cs_new_protected_nopar:Npn \msg_kernel_info:nxx {
- \msg_info:nnxx { LaTeX }
+\cs_new_protected_nopar:Npn \msg_kernel_info:nnxxxx #1#2 {
+ \msg_info:nnxxxx { LaTeX } { #1 / #2 }
}
\msg_kernel_classes_new:n { info }
% \end{macrocode}
@@ -1284,50 +1305,49 @@
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
%
-% Some very basic error messages.
+% Error messages needed to actually implement the message system
+% itself.
% \begin{macrocode}
-\msg_kernel_new:nnn { coding-bug } {%
- This is a LaTeX bug: check coding!\\%
- #1%
-}{%
- #2%
-}
-\msg_kernel_new:nnn { message-unknown } {%
- Unknown message `#2' for module `#1'.%
-}{%
- LaTeX was asked to display a message by the `#1' module.\\%
- The message was supposed to be called `#2', but I can't\\%
- find a message with that name.
- \c_msg_return_text_tl
-}
-\msg_kernel_new:nnn { message-class-unknown } {%
- Unknown message class `#1'.%
-}{%
- You have asked for a message to be redirected to class `#1'\\%
- but this class is unknown.
- \c_msg_return_text_tl
-}
-\msg_kernel_new:nnn { message-loop } {%
- Message redirection loop.%
-}{%
- You have asked for a message to be redirected,\\%
- but the redirection instructions form a loop:\\%
- you've lost the message.
- \c_msg_return_text_tl
-}
+\msg_kernel_new:nnnn { msg } { message-unknown }
+ {Unknown message `#2' for module `#1'.}
+ {%
+ LaTeX was asked to display a message by the `#1' module.\\%
+ The message was supposed to be called `#2', but I can't\\%
+ find a message with that name.%
+ \c_msg_return_text_tl
+ }
+\msg_kernel_new:nnnn { msg } { message-class-unknown }
+ {Unknown message class `#1'.}
+ {%
+ You have asked for a message to be redirected to class `#1'.\\%
+ The message class `#1' has not been set up:\\%
+ perhaps this is a typing error.%
+ \c_msg_return_text_tl
+ }
+\msg_kernel_new:nnnn { msg } { redirect-loop }
+ {Message redirection loop for message class `#1'.}
+ {%
+ You have asked for a message to be redirected,\\%
+ but the redirection instructions form a loop:\\%
+ you've lost the message.%
+ \c_msg_return_text_tl
+ }
% \end{macrocode}
%
%\begin{macro}{\msg_kernel_bug:x}
% The \LaTeX\ coding bug error gets re-visited here.
% \begin{macrocode}
-\cs_set_protected:Nn \msg_kernel_bug:x {
- \msg_direct_interrupt:xxxxn
+\cs_set_protected:Npn \msg_kernel_bug:x #1 {
+ \msg_direct_interrupt:xxxx
{ \c_msg_kernel_bug_text_tl }
{ !~#1 }
{ ! }
{ \c_msg_kernel_bug_more_text_tl }
- { }
}
% \end{macrocode}
%\end{macro}