summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex/maincontrol.c
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2022-01-12 11:25:59 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2022-01-12 11:25:59 +0000
commit8316f1c459bab0a9894b74d3f86494563293aa22 (patch)
tree7cdaef784a6dcdfa8987beb955012a954113a163 /Build/source/texk/web2c/luatexdir/tex/maincontrol.c
parente4d46f96d5158c0d6b997c52896c94397ecb6ffc (diff)
LuaTeX \showstream (M.Krüger)
git-svn-id: svn://tug.org/texlive/trunk@61580 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex/maincontrol.c')
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/maincontrol.c20
1 files changed, 18 insertions, 2 deletions
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);