src/Pure/Isar/isar_cmd.ML
changeset 60082 d3573eb7728f
parent 59930 bdbc4b761c31
child 60095 c48d536231fe
     1.1 --- a/src/Pure/Isar/isar_cmd.ML	Wed Apr 15 17:34:45 2015 +0200
     1.2 +++ b/src/Pure/Isar/isar_cmd.ML	Wed Apr 15 19:08:37 2015 +0200
     1.3 @@ -270,33 +270,22 @@
     1.4  
     1.5  (* display dependencies *)
     1.6  
     1.7 -val thy_deps = Toplevel.unknown_theory o Toplevel.keep (fn state =>
     1.8 -  let
     1.9 -    val thy = Toplevel.theory_of state;
    1.10 -    val thy_session = Present.session_name thy;
    1.11 -  in
    1.12 -    Theory.nodes_of thy
    1.13 -    |> map (fn thy_node =>
    1.14 -        let
    1.15 -          val name = Context.theory_name thy_node;
    1.16 -          val parents = map Context.theory_name (Theory.parents_of thy_node);
    1.17 -          val session = Present.session_name thy_node;
    1.18 -          val node =
    1.19 -            Graph_Display.session_node
    1.20 -              {name = name, directory = session, unfold = session = thy_session, path = ""};
    1.21 -        in ((name, node), parents) end)
    1.22 -    |> Graph_Display.display_graph
    1.23 -  end);
    1.24 +val thy_deps =
    1.25 +  Toplevel.unknown_theory o
    1.26 +  Toplevel.keep (fn st =>
    1.27 +    let
    1.28 +      val thy = Toplevel.theory_of st;
    1.29 +      val parent_session = Session.get_name ();
    1.30 +      val parent_loaded = is_some o Thy_Info.lookup_theory;
    1.31 +    in Graph_Display.display_graph (Present.session_graph parent_session parent_loaded thy) end);
    1.32  
    1.33 -val locale_deps = Toplevel.unknown_theory o Toplevel.keep (fn state =>
    1.34 -  let
    1.35 -    val thy = Toplevel.theory_of state;
    1.36 -  in
    1.37 +val locale_deps =
    1.38 +  Toplevel.unknown_theory o
    1.39 +  Toplevel.keep (Toplevel.theory_of #> (fn thy =>
    1.40      Locale.pretty_locale_deps thy
    1.41      |> map (fn {name, parents, body} =>
    1.42        ((name, Graph_Display.content_node (Locale.extern thy name) [body]), parents))
    1.43 -    |> Graph_Display.display_graph
    1.44 -  end);
    1.45 +    |> Graph_Display.display_graph));
    1.46  
    1.47  
    1.48  (* print theorems, terms, types etc. *)