src/Doc/antiquote_setup.ML
changeset 57334 54c6b73774d2
parent 56467 8d7d6f17c6a7
child 57477 c3b5cb53ea79
     1.1 --- a/src/Doc/antiquote_setup.ML	Mon Jun 16 20:50:56 2014 +0200
     1.2 +++ b/src/Doc/antiquote_setup.ML	Mon Jun 16 21:26:50 2014 +0200
     1.3 @@ -166,21 +166,32 @@
     1.4        | NONE => [])
     1.5    | parse_named _ _ = [];
     1.6  
     1.7 -val jedit_actions =
     1.8 +val isabelle_jedit_actions =
     1.9    (case XML.parse (File.read @{path "~~/src/Tools/jEdit/src/actions.xml"}) of
    1.10      XML.Elem (("ACTIONS", _), body) => maps (parse_named "ACTION") body
    1.11    | _ => []);
    1.12  
    1.13 -val jedit_dockables =
    1.14 +val isabelle_jedit_dockables =
    1.15    (case XML.parse (File.read @{path "~~/src/Tools/jEdit/src/dockables.xml"}) of
    1.16      XML.Elem (("DOCKABLES", _), body) => maps (parse_named "DOCKABLE") body
    1.17    | _ => []);
    1.18  
    1.19 -val all_actions = jedit_actions @ jedit_dockables;
    1.20 +val jedit_actions =
    1.21 +  Lazy.lazy (fn () =>
    1.22 +    (case Isabelle_System.bash_output
    1.23 +      "unzip -p \"$JEDIT_HOME/dist/jedit.jar\" org/gjt/sp/jedit/actions.xml" of
    1.24 +      (txt, 0) =>
    1.25 +        (case XML.parse txt of
    1.26 +          XML.Elem (("ACTIONS", _), body) => maps (parse_named "ACTION") body
    1.27 +        | _ => [])
    1.28 +    | (_, rc) => error ("Cannot unzip jedit.jar\nreturn code = " ^ string_of_int rc)));
    1.29  
    1.30  in
    1.31  
    1.32 -val is_action = member (op =) all_actions;
    1.33 +fun is_action a =
    1.34 +  member (op =) isabelle_jedit_actions a orelse
    1.35 +  member (op =) isabelle_jedit_dockables a orelse
    1.36 +  member (op =) (Lazy.force jedit_actions) a;
    1.37  
    1.38  end;
    1.39