--- a/src/Pure/ProofGeneral/proof_general_emacs.ML Wed Sep 03 11:26:59 2008 +0200
+++ b/src/Pure/ProofGeneral/proof_general_emacs.ML Wed Sep 03 11:27:15 2008 +0200
@@ -176,7 +176,9 @@
in
fun setup_present_hook () = Toplevel.add_hook (fn _ => fn state => fn state' =>
- if print_mode_active thm_depsN andalso Toplevel.is_theory state' then
+ if print_mode_active thm_depsN andalso
+ can Toplevel.theory_of state andalso Toplevel.is_theory state'
+ then
let val (names, deps) =
ProofGeneralPgip.new_thms_deps (Toplevel.theory_of state) (Toplevel.theory_of state')
in