--- a/src/Tools/jEdit/lib/Tools/jedit Fri Sep 06 17:01:49 2013 +0200
+++ b/src/Tools/jEdit/lib/Tools/jedit Fri Sep 06 17:20:48 2013 +0200
@@ -330,23 +330,6 @@
## main
if [ "$BUILD_ONLY" = false ]; then
- mkdir -p "$JEDIT_SETTINGS/DockableWindowManager"
-
- if [ ! -e "$JEDIT_SETTINGS/perspective.xml" ]; then
- cat > "$JEDIT_SETTINGS/DockableWindowManager/perspective-view0.xml" <<EOF
-<DOCKING LEFT="" TOP="" RIGHT="" BOTTOM="isabelle-readme" LEFT_POS="0" TOP_POS="0" RIGHT_POS="250" BOTTOM_POS="250" />
-EOF
- cat > "$JEDIT_SETTINGS/perspective.xml" <<EOF
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE PERSPECTIVE SYSTEM "perspective.dtd">
-<PERSPECTIVE>
-<VIEW PLAIN="FALSE">
-<GEOMETRY X="0" Y="35" WIDTH="1072" HEIGHT="787" EXT_STATE="0" />
-</VIEW>
-</PERSPECTIVE>
-EOF
- fi
-
if [ "$NO_BUILD" = false ]; then
"$ISABELLE_TOOL" build_dialog "${BUILD_DIALOG_OPTIONS[@]}"
RC="$?"
--- a/src/Tools/jEdit/src/jedit_main.scala Fri Sep 06 17:01:49 2013 +0200
+++ b/src/Tools/jEdit/src/jedit_main.scala Fri Sep 06 17:20:48 2013 +0200
@@ -20,10 +20,27 @@
GUI.init_laf()
Isabelle_System.init()
- val file_args =
- if (args.isEmpty)
- Array(Isabelle_System.platform_path(Path.explode("$USER_HOME/Scratch.thy")))
- else args
+
+ /* settings directory */
+
+ val settings_dir = Path.explode("$JEDIT_SETTINGS")
+ Isabelle_System.mkdirs(settings_dir + Path.explode("DockableWindowManager"))
+
+ if (!(settings_dir + Path.explode("perspective.xml")).is_file) {
+ File.write(settings_dir + Path.explode("DockableWindowManager/perspective-view0.xml"),
+ """<DOCKING LEFT="" TOP="" RIGHT="" BOTTOM="isabelle-readme" LEFT_POS="0" TOP_POS="0" RIGHT_POS="250" BOTTOM_POS="250" />""")
+ File.write(settings_dir + Path.explode("perspective.xml"),
+ """<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE PERSPECTIVE SYSTEM "perspective.dtd">
+<PERSPECTIVE>
+<VIEW PLAIN="FALSE">
+<GEOMETRY X="0" Y="35" WIDTH="1072" HEIGHT="787" EXT_STATE="0" />
+</VIEW>
+</PERSPECTIVE>""")
+ }
+
+
+ /* args */
val jedit_options =
Isabelle_System.getenv_strict("JEDIT_OPTIONS").split(" +")
@@ -31,10 +48,18 @@
val jedit_settings =
Array("-settings=" + Isabelle_System.platform_path(Path.explode("$JEDIT_SETTINGS")))
+ val more_args =
+ if (args.isEmpty)
+ Array(Isabelle_System.platform_path(Path.explode("$USER_HOME/Scratch.thy")))
+ else args
+
+
+ /* startup */
+
System.setProperty("jedit.home",
Isabelle_System.platform_path(Path.explode("$JEDIT_HOME/dist")))
- jEdit.main(jedit_options ++ jedit_settings ++ file_args)
+ jEdit.main(jedit_options ++ jedit_settings ++ more_args)
}
}