aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ide/ideutils.ml6
-rw-r--r--lib/pp_control.ml4
-rw-r--r--lib/pp_control.mli2
-rw-r--r--library/lib.ml12
-rw-r--r--library/lib.mli2
-rw-r--r--toplevel/coqtop.ml1
-rw-r--r--toplevel/vernacentries.ml2
7 files changed, 18 insertions, 11 deletions
diff --git a/ide/ideutils.ml b/ide/ideutils.ml
index a3fd09084..dfcf61ef5 100644
--- a/ide/ideutils.ml
+++ b/ide/ideutils.ml
@@ -151,9 +151,13 @@ let set_highlight_timer f =
let init_stdout,read_stdout,clear_stdout =
let out_buff = Buffer.create 100 in
let out_ft = Format.formatter_of_buffer out_buff in
+ let deep_out_ft = Format.formatter_of_buffer out_buff in
+ let _ = Pp_control.set_gp deep_out_ft Pp_control.deep_gp in
(fun () ->
Pp_control.std_ft := out_ft;
- Pp_control.err_ft := out_ft),
+ Pp_control.err_ft := out_ft;
+ Pp_control.deep_ft := deep_out_ft;
+),
(fun () -> Format.pp_print_flush out_ft ();
let r = Buffer.contents out_buff in
prerr_endline "Output from Coq is: "; prerr_endline r;
diff --git a/lib/pp_control.ml b/lib/pp_control.ml
index e43916125..67ae4a20a 100644
--- a/lib/pp_control.ml
+++ b/lib/pp_control.ml
@@ -92,8 +92,8 @@ let _ = set_dflt_gp !std_ft
let err_ft = ref Format.err_formatter
let _ = set_gp !err_ft deep_gp
-let deep_ft = with_output_to stdout
-let _ = set_gp deep_ft deep_gp
+let deep_ft = ref (with_output_to stdout)
+let _ = set_gp !deep_ft deep_gp
(* For parametrization through vernacular *)
let default = Format.pp_get_max_boxes !std_ft ()
diff --git a/lib/pp_control.mli b/lib/pp_control.mli
index 3c008aaca..b43584f34 100644
--- a/lib/pp_control.mli
+++ b/lib/pp_control.mli
@@ -38,7 +38,7 @@ val with_output_to : out_channel -> Format.formatter
val std_ft : Format.formatter ref
val err_ft : Format.formatter ref
-val deep_ft : Format.formatter
+val deep_ft : Format.formatter ref
(*s For parametrization through vernacular. *)
diff --git a/library/lib.ml b/library/lib.ml
index 1db433c19..ae1a41ca1 100644
--- a/library/lib.ml
+++ b/library/lib.ml
@@ -489,15 +489,15 @@ let section_instance = function
| IndRef (kn,_) | ConstructRef ((kn,_),_) ->
KNmap.find kn (snd (pi2 (List.hd !sectab)))
-let init () = sectab := []
-let freeze () = !sectab
-let unfreeze s = sectab := s
+let init_sectab () = sectab := []
+let freeze_sectab () = !sectab
+let unfreeze_sectab s = sectab := s
let _ =
Summary.declare_summary "section-context"
- { Summary.freeze_function = freeze;
- Summary.unfreeze_function = unfreeze;
- Summary.init_function = init;
+ { Summary.freeze_function = freeze_sectab;
+ Summary.unfreeze_function = unfreeze_sectab;
+ Summary.init_function = init_sectab;
Summary.survive_module = false;
Summary.survive_section = false }
diff --git a/library/lib.mli b/library/lib.mli
index ba04fa1b7..da8ace048 100644
--- a/library/lib.mli
+++ b/library/lib.mli
@@ -157,6 +157,8 @@ type frozen
val freeze : unit -> frozen
val unfreeze : frozen -> unit
+val init : unit -> unit
+
val declare_initial_state : unit -> unit
val reset_initial : unit -> unit
diff --git a/toplevel/coqtop.ml b/toplevel/coqtop.ml
index b9ca8bc8a..a4dee4b6e 100644
--- a/toplevel/coqtop.ml
+++ b/toplevel/coqtop.ml
@@ -305,6 +305,7 @@ let parse_args is_ide =
let init is_ide =
Sys.catch_break false; (* Ctrl-C is fatal during the initialisation *)
+ Lib.init();
begin
try
parse_args is_ide;
diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml
index 78d3598ef..e9b49e7e8 100644
--- a/toplevel/vernacentries.ml
+++ b/toplevel/vernacentries.ml
@@ -95,7 +95,7 @@ let show_script () =
let pts = get_pftreestate () in
let pf = proof_of_pftreestate pts
and evc = evc_of_pftreestate pts in
- msgnl_with Pp_control.deep_ft (print_treescript true evc pf)
+ msgnl_with !Pp_control.deep_ft (print_treescript true evc pf)
let show_thesis () =
msgnl (anomaly "TODO" )