diff options
author | Karl Berry <karl@freefriends.org> | 2019-07-02 21:03:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-07-02 21:03:06 +0000 |
commit | 6cd9cb9b90a640486b1e6cf9bf4385e1622dc621 (patch) | |
tree | 55b66dec7d3519db5b1b299ba0ae90aa4fe2714d /Master/texmf-dist/source/latex/l3kernel/l3msg.dtx | |
parent | 0eeaf7545f37a529bbc7549c23ec0f2160e509e0 (diff) |
l3 (2jul19)
git-svn-id: svn://tug.org/texlive/trunk@51534 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.dtx | 101 |
1 files changed, 56 insertions, 45 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx index 4f3d8a69327..733c6b5e844 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3msg.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-05-28} +% \date{Released 2019-07-01} % % \maketitle % @@ -290,7 +290,8 @@ % \end{syntax} % Issues \meta{module} error \meta{message}, passing \meta{arg one} to % \meta{arg four} to the text-creating functions. After issuing a -% fatal error the \TeX{} run halts. +% fatal error the \TeX{} run halts. No PDF file will be produced in +% this case (DVI mode runs may produce a truncated DVI file). % \end{function} % % \begin{function}[updated = 2012-08-11] @@ -509,10 +510,10 @@ %<@@=msg> % \end{macrocode} % -% \begin{variable}{\l_@@_tmp_tl} +% \begin{variable}{\l_@@_internal_tl} % A general scratch for the module. % \begin{macrocode} -\tl_new:N \l_@@_tmp_tl +\tl_new:N \l_@@_internal_tl % \end{macrocode} % \end{variable} % @@ -674,31 +675,48 @@ % \subsection{Showing messages: low level mechanism} % % \begin{macro}{\@@_interrupt:Nnnn} +% \begin{macro}{\@@_no_more_text:nnnn} % The low-level interruption macro is rather opaque, unfortunately. % Depending on the availability of more information there is a choice % of how to set up the further help. We feed the extra help text and % the message itself to a wrapping auxiliary, in this order because we % must first setup \TeX{}'s \tn{errhelp} register before issuing an -% \tn{errmessage}. +% \tn{errmessage}. To deal with the various cases of critical or fatal +% errors with and without help text, there is a bit of argument-passing +% to do. % \begin{macrocode} -\cs_new_protected:Npn \@@_interrupt:Nnnn #1#2#3#4 +\cs_new_protected:Npn \@@_interrupt:NnnnN #1#2#3#4#5 { \str_set:Nx \l_@@_text_str { #1 {#2} } \str_set:Nx \l_@@_name_str { \msg_module_name:n {#2} } - \tl_if_empty:nTF {#4} + \cs_if_eq:cNTF + { \c_@@_more_text_prefix_tl #2 / #3 } + \@@_no_more_text:nnnn { - \@@_interrupt_wrap:nnn {#3} + \@@_interrupt_wrap:nnn + { \use:c { \c_@@_text_prefix_tl #2 / #3 } #4 } { \c_@@_continue_text_tl } - { \c_@@_no_info_text_tl } + { + \c_@@_no_info_text_tl + \tl_if_empty:NF #5 + { \\ \\ #5 } + } } { - \@@_interrupt_wrap:nnn {#3} + \@@_interrupt_wrap:nnn + { \use:c { \c_@@_text_prefix_tl #2 / #3 } #4 } { \c_@@_help_text_tl } - {#4} + { + \use:c { \c_@@_more_text_prefix_tl #2 / #3 } #4 + \tl_if_empty:NF #5 + { \\ \\ #5 } + } } } +\cs_new:Npn \@@_no_more_text:nnnn #1#2#3#4 { } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro}{\@@_interrupt_wrap:nnn} % \begin{macro}{\@@_interrupt_text:n, \@@_interrupt_more_text:n} @@ -730,13 +748,13 @@ { ~ } } { } \@@_interrupt_text:n - \iow_wrap:nnnN { \l_@@_tmp_tl \\ \\ #2 } { } { } + \iow_wrap:nnnN { \l_@@_internal_tl \\ \\ #2 } { } { } \@@_interrupt:n } \cs_new_protected:Npn \@@_interrupt_text:n #1 { \group_end: - \tl_set:Nn \l_@@_tmp_tl {#1} + \tl_set:Nn \l_@@_internal_tl {#1} } \cs_new_protected:Npn \@@_interrupt_more_text:n #1 { \exp_args:Nx \tex_errhelp:D { #1 \iow_newline: } } @@ -967,19 +985,27 @@ % \msg_fatal:nnxx , % \msg_fatal:nnx % } -% For fatal errors, after the error message \TeX{} bails out. +% \begin{macro}{\@@_fatal_exit:} +% For fatal errors, after the error message \TeX{} bails out. We force +% a bail out rather than using \tn{end} as this means it does not +% matter if we are in a context where normally the run cannot end. % \begin{macrocode} \@@_class_new:nn { fatal } { - \@@_interrupt:Nnnn - \msg_fatal_text:n - {#1} - { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} } - { \c_@@_fatal_text_tl } - \tex_end:D + \@@_interrupt:NnnnN + \msg_fatal_text:n {#1} {#2} + { {#3} {#4} {#5} {#6} } + \c_@@_fatal_text_tl + \@@_fatal_exit: + } + \cs_new_protected:Npn \@@_fatal_exit: + { + \tex_batchmode:D + \tex_read:D -1 to \l_@@_internal_tl } % \end{macrocode} % \end{macro} +% \end{macro} % % \begin{macro} % { @@ -997,11 +1023,10 @@ % \begin{macrocode} \@@_class_new:nn { critical } { - \@@_interrupt:Nnnn - \msg_critical_text:n - {#1} - { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} } - { \c_@@_critical_text_tl } + \@@_interrupt:NnnnN + \msg_critical_text:n {#1} {#2} + { {#3} {#4} {#5} {#6} } + \c_@@_critical_text_tl \tex_endinput:D } % \end{macrocode} @@ -1019,33 +1044,19 @@ % \msg_error:nnxx , % \msg_error:nnx % } -% \begin{macro}{\@@_error:cnnnnn, \@@_no_more_text:nnnn} % For an error, the interrupt routine is called. We check if there is % a \enquote{more text} by comparing that control sequence with a % permanently empty text. % \begin{macrocode} \@@_class_new:nn { error } { - \@@_error:cnnnnn - { \c_@@_more_text_prefix_tl #1 / #2 } - {#3} {#4} {#5} {#6} - { - \@@_interrupt:Nnnn - \msg_error_text:n - {#1} - { \use:c { \c_@@_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} } - } + \@@_interrupt:NnnnN + \msg_error_text:n {#1} {#2} + { {#3} {#4} {#5} {#6} } + \c_empty_tl } - \cs_new_protected:Npn \@@_error:cnnnnn #1#2#3#4#5#6 - { - \cs_if_eq:cNTF {#1} \@@_no_more_text:nnnn - { #6 { } } - { #6 { \use:c {#1} {#2} {#3} {#4} {#5} } } - } - \cs_new:Npn \@@_no_more_text:nnnn #1#2#3#4 { } % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro} % { @@ -1215,13 +1226,13 @@ { \tl_if_empty:nF {#1} { \exp_args:No \iow_term:n { \use_none:n #1 } } - \tl_set:Nn \l_@@_tmp_tl {#2} + \tl_set:Nn \l_@@_internal_tl {#2} \__kernel_iow_with:Nnn \tex_newlinechar:D { 10 } { \__kernel_iow_with:Nnn \tex_errorcontextlines:D { -1 } { \tex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \l_@@_tmp_tl } + { \exp_after:wN \l_@@_internal_tl } } } } |