aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel/vernacentries.ml
diff options
context:
space:
mode:
authorGravatar Arnaud Spiwack <arnaud@spiwack.net>2014-10-28 15:29:52 +0100
committerGravatar Arnaud Spiwack <arnaud@spiwack.net>2014-11-01 22:43:57 +0100
commitd47c178be6e5dc52fedbb312fc51673623608994 (patch)
tree0e0cbbf7ac6124a0bb8062c5f908d4d9b724f2bc /toplevel/vernacentries.ml
parentdd98363034c871ac858257cf71f089ca03c17ac1 (diff)
Add an [Info Level] option to print info traces automatically.
[Set Info Level n] prints all info traces at level [n]. [Unset Info Level] stops the automatic printing of info traces. The unfolding level [n] can be overloaded by local [Info m tac] calls.
Diffstat (limited to 'toplevel/vernacentries.ml')
-rw-r--r--toplevel/vernacentries.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/toplevel/vernacentries.ml b/toplevel/vernacentries.ml
index af7d2a723..ae7f2b118 100644
--- a/toplevel/vernacentries.ml
+++ b/toplevel/vernacentries.ml
@@ -800,12 +800,24 @@ let command_focus = Proof.new_focus_kind ()
let focus_command_cond = Proof.no_cond command_focus
+let print_info_trace = ref None
+
+let _ = let open Goptions in declare_int_option {
+ optsync = true;
+ optdepr = false;
+ optname = "print info trace";
+ optkey = ["Info" ; "Level"];
+ optread = (fun () -> !print_info_trace);
+ optwrite = fun n -> print_info_trace := n;
+}
+
let vernac_solve n info tcom b =
if not (refining ()) then
error "Unknown command of the non proof-editing mode.";
let status = Proof_global.with_current_proof (fun etac p ->
let with_end_tac = if b then Some etac else None in
let global = match n with SelectAll -> true | _ -> false in
+ let info = Option.append info !print_info_trace in
let (p,status) =
solve n info (Tacinterp.hide_interp global tcom None) ?with_end_tac p
in