|
101 | 101 | % This library provides tools for generating and interacting with Prolog documentation.
|
102 | 102 | :- ensure_loaded(library(pldoc)).
|
103 | 103 |
|
| 104 | +/* |
104 | 105 | % Set the encoding of the `current_input` stream to UTF-8.
|
105 | 106 | % This ensures that any input read from `current_input` (which is typically `user_input`) is interpreted as UTF-8.
|
106 | 107 | :- set_stream(current_input, encoding(utf8)).
|
|
128 | 129 | % Flush any pending output to ensure that anything waiting to be written to output is immediately written.
|
129 | 130 | % Useful to make sure output is synchronized and nothing is left in the buffer.
|
130 | 131 | :- flush_output.
|
131 |
| - |
| 132 | +*/ |
132 | 133 | %:- set_prolog_flag(debug_on_interrupt,true).
|
133 | 134 | %:- set_prolog_flag(compile_meta_arguments,control).
|
134 | 135 | :- (prolog_load_context(directory, Value);Value='.'), absolute_file_name('../packs/',Dir,[relative_to(Value)]),
|
|
296 | 297 | keep_output:- is_win64,!.
|
297 | 298 | keep_output:- is_mettalog,!.
|
298 | 299 | keep_output:- is_testing,!.
|
| 300 | + |
299 | 301 | keep_output:- is_compatio,!,fail.
|
300 | 302 |
|
301 | 303 |
|
302 | 304 | :- volatile(original_user_output/1).
|
303 | 305 | :- dynamic(original_user_output/1).
|
304 | 306 | original_user_output(X):- stream_property(X,file_no(1)).
|
305 | 307 | original_user_error(X):- stream_property(X,file_no(2)).
|
306 |
| -:- original_user_output(_)->true;current_output(Out),asserta(original_user_output(Out)). |
| 308 | +:- original_user_output(_)->true;(current_output(Out),asserta(original_user_output(Out))). |
307 | 309 | unnullify_output:- current_output(MFS), original_user_output(OUT), MFS==OUT, !.
|
308 | 310 | unnullify_output:- original_user_output(MFS), set_prolog_IO(user_input,MFS,user_error).
|
309 | 311 |
|
|
639 | 641 | ).
|
640 | 642 |
|
641 | 643 | null_io(G):- null_user_output(Out), !, with_output_to(Out,G).
|
| 644 | +user_io(G):- current_prolog_flag(mettalog_rt, true), !, original_user_error(Out), ttyflush, !, with_output_to(Out,G), flush_output(Out), ttyflush. |
642 | 645 | user_io(G):- original_user_output(Out), ttyflush, !, with_output_to(Out,G), flush_output(Out), ttyflush.
|
643 | 646 | user_err(G):- original_user_error(Out), !, with_output_to(Out,G).
|
644 | 647 | with_output_to_s(Out,G):- current_output(COut),
|
|
0 commit comments