summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3msg.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3msg.dtx68
1 files changed, 49 insertions, 19 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
index 1adc34d8e17..0e48e2abac8 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx
@@ -37,7 +37,7 @@
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3msg.dtx 4943 2014-05-30 17:26:32Z bruno $
+\GetIdInfo$Id: l3msg.dtx 5358 2014-08-24 09:19:52Z bruno $
{L3 Messages}
%</driver|package>
%<*driver>
@@ -1011,8 +1011,20 @@
% trailing closing braces are turned into spaces to hide them as well.
% The group in which we alter the definition of the active |!| is
% closed before producing the message: this ensures that tokens
-% inserted by typing |I| in the command-line will bee inserted after
+% inserted by typing |I| in the command-line will be inserted after
% the message is entirely cleaned up.
+
+% The \cs{__iow_with:Nnn} auxiliary, defined in \pkg{l3file}, expects
+% an \meta{integer variable}, an integer \meta{value}, and some
+% \meta{code}. It runs the \meta{code} after ensuring that the
+% \meta{integer variable} takes the given \meta{value}, then restores
+% the former value of the \meta{integer variable} if needed. We use
+% it to ensure that the \tn{newlinechar} is $10$, as needed for
+% \cs{iow_newline:} to work, and that \tn{errorcontextlines} is $-1$,
+% to avoid showing irrelevant context. Note that restoring the former
+% value of these integers requires inserting tokens after the
+% \tn{errmessage}, which go in the way of tokens which could be
+% inserted by the user. This is unavoidable.
% \begin{macrocode}
\group_begin:
\char_set_lccode:nn {`\{} {`\ }
@@ -1031,19 +1043,25 @@
\iow_newline:
!
}
- \group_begin:
- \cs_set_protected_nopar:Npn &
- {
- \tex_errmessage:D
- {
- #1
- \use_none:n
- { ............................................ }
- }
- }
- \exp_after:wN
- \group_end:
- &
+ \__iow_with:Nnn \tex_newlinechar:D { `\^^J }
+ {
+ \__iow_with:Nnn \tex_errorcontextlines:D \c_minus_one
+ {
+ \group_begin:
+ \cs_set_protected_nopar:Npn &
+ {
+ \tex_errmessage:D
+ {
+ #1
+ \use_none:n
+ { ............................................ }
+ }
+ }
+ \exp_after:wN
+ \group_end:
+ &
+ }
+ }
}
}
% \end{macrocode}
@@ -1120,7 +1138,8 @@
\cs_set_protected:Npn \@@_class_new:nn #1#2
{
\prop_new:c { l_@@_redirect_ #1 _prop }
- \cs_new_protected:cpn { @@_ #1 _code:nnnnnn } ##1##2##3##4##5##6 {#2}
+ \cs_new_protected:cpn { @@_ #1 _code:nnnnnn }
+ ##1##2##3##4##5##6 {#2}
\cs_new_protected:cpn { msg_ #1 :nnnnnn } ##1##2##3##4##5##6
{
\use:x
@@ -1574,7 +1593,8 @@
\tl_if_eq:NNTF \l_@@_class_tl \l_@@_current_class_tl
{
\prop_put:cnn { l_@@_redirect_ #2 _prop } {#3} {#2}
- \@@_kernel_warning:nnxxxx { kernel } { message-redirect-loop }
+ \@@_kernel_warning:nnxxxx
+ { kernel } { message-redirect-loop }
{ \seq_item:Nn \l_@@_class_loop_seq { \c_one } }
{ \seq_item:Nn \l_@@_class_loop_seq { \c_two } }
{#3}
@@ -2080,6 +2100,10 @@
% 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.
+% The calls to \cs{__iow_with:Nnn} ensure that the \tn{newlinechar} is
+% set to~$10$ so that the \cs{iow_newline:} inserted by the
+% line-wrapping code are correctly recognized by \TeX{}, and that
+% \tn{errorcontextlines} is $-1$ to avoid printing irrelevant context.
% \begin{macrocode}
\cs_new_protected:Npn \@@_show_variable:Nnn #1#2#3
{
@@ -2100,8 +2124,14 @@
\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 }
+ \__iow_with:Nnn \tex_newlinechar:D { 10 }
+ {
+ \__iow_with:Nnn \tex_errorcontextlines:D \c_minus_one
+ {
+ \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN
+ { \exp_after:wN \l_@@_internal_tl }
+ }
+ }
}
\cs_new:Npn \@@_show_variable_aux:w #1 > { }
% \end{macrocode}