From 8316f1c459bab0a9894b74d3f86494563293aa22 Mon Sep 17 00:00:00 2001 From: Luigi Scarso Date: Wed, 12 Jan 2022 11:25:59 +0000 Subject: LuaTeX \showstream (M.Krüger) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://tug.org/texlive/trunk@61580 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/tex/maincontrol.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'Build/source/texk/web2c/luatexdir/tex/maincontrol.c') diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.c b/Build/source/texk/web2c/luatexdir/tex/maincontrol.c index f72659c5064..4f91283b9c0 100644 --- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.c +++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.c @@ -4055,12 +4055,16 @@ void show_whatever(void) int n; /* level of \.{\\if...\\fi} nesting */ switch (cur_chr) { case show_lists: + if (file_can_be_written(show_stream_par)) + selector = show_stream_par; begin_diagnostic(); show_activities(); break; case show_box_code: /*tex Show the current contents of a box. */ scan_register_num(); + if (file_can_be_written(show_stream_par)) + selector = show_stream_par; begin_diagnostic(); tprint_nl("> \\box"); print_int(cur_val); @@ -4073,7 +4077,9 @@ void show_whatever(void) case show_code: /*tex Show the current meaning of a token, then |goto common_ending|. */ get_token(); - if (interaction == error_stop_mode) + if (file_can_be_written(show_stream_par)) + selector = show_stream_par; + else if (interaction == error_stop_mode) wake_up_terminal(); tprint_nl("> "); if (cur_cs != 0) { @@ -4085,10 +4091,14 @@ void show_whatever(void) break; /*tex Cases for |show_whatever| */ case show_groups: + if (file_can_be_written(show_stream_par)) + selector = show_stream_par; begin_diagnostic(); show_save_groups(); break; case show_ifs: + if (file_can_be_written(show_stream_par)) + selector = show_stream_par; begin_diagnostic(); tprint_nl(""); print_ln(); @@ -4128,7 +4138,9 @@ void show_whatever(void) common_ending|. */ p = the_toks(); - if (interaction == error_stop_mode) + if (file_can_be_written(show_stream_par)) + selector = show_stream_par; + else if (interaction == error_stop_mode) wake_up_terminal(); tprint_nl("> "); token_show(temp_token_head); @@ -4147,6 +4159,10 @@ void show_whatever(void) } } COMMON_ENDING: + if (valid_write_file(selector)) { + fixup_selector(log_opened_global); + return; + } if (interaction < error_stop_mode) { help0(); decr(error_count); -- cgit v1.2.3