--- a/src/Pure/Isar/isar_cmd.ML Mon Jul 30 10:39:12 2007 +0200
+++ b/src/Pure/Isar/isar_cmd.ML Mon Jul 30 11:12:28 2007 +0200
@@ -315,7 +315,8 @@
val welcome = Toplevel.imperative (writeln o Session.welcome);
val exit = Toplevel.keep (fn state =>
- (ML_Context.set_context (try Toplevel.generic_theory_of state); raise Toplevel.TERMINATE));
+ (CRITICAL (fn () => ML_Context.set_context (try Toplevel.generic_theory_of state));
+ raise Toplevel.TERMINATE));
val quit = Toplevel.imperative quit;
--- a/src/Pure/Isar/outer_syntax.ML Mon Jul 30 10:39:12 2007 +0200
+++ b/src/Pure/Isar/outer_syntax.ML Mon Jul 30 11:12:28 2007 +0200
@@ -280,7 +280,7 @@
fun load_thy dir name pos text ml time =
(run_thy dir name pos text time;
- ML_Context.set_context (SOME (Context.Theory (ThyInfo.get_theory name)));
+ CRITICAL (fn () => ML_Context.set_context (SOME (Context.Theory (ThyInfo.get_theory name))));
if ml then try_ml_file dir name time else ());
in
@@ -296,7 +296,7 @@
(* main loop *)
fun gen_loop term =
- (ML_Context.set_context NONE;
+ (CRITICAL (fn () => ML_Context.set_context NONE);
Toplevel.loop (isar term));
fun gen_main term =
--- a/src/Pure/Thy/thy_info.ML Mon Jul 30 10:39:12 2007 +0200
+++ b/src/Pure/Thy/thy_info.ML Mon Jul 30 11:12:28 2007 +0200
@@ -454,7 +454,7 @@
let val name = base_name str in
check_unfinished warning name;
gen_use_thy' req Path.current str;
- ML_Context.set_context (SOME (Context.Theory (get_theory name)))
+ CRITICAL (fn () => ML_Context.set_context (SOME (Context.Theory (get_theory name))))
end;
in
@@ -497,7 +497,8 @@
val _ = check_unfinished error name;
val _ = if int then quiet_update_thys dir parents else ();
(* FIXME tmp *)
- val _ = ML_Context.set_context (SOME (Context.Theory (get_theory (List.last parent_names))));
+ val _ = CRITICAL (fn () =>
+ ML_Context.set_context (SOME (Context.Theory (get_theory (List.last parent_names)))));
val _ = check_uses name uses;
val theory =