# HG changeset patch # User wenzelm # Date 1647860151 -3600 # Node ID e4d6b9bd5071064fedaee948724ab02f74d15200 # Parent c9ee3028c125f321ce7aa713f12bc81cc42111fd clarified module name; diff -r c9ee3028c125 -r e4d6b9bd5071 Admin/Windows/launch4j/isabelle.xml --- a/Admin/Windows/launch4j/isabelle.xml Mon Mar 21 11:40:11 2022 +0100 +++ b/Admin/Windows/launch4j/isabelle.xml Mon Mar 21 11:55:51 2022 +0100 @@ -15,7 +15,7 @@ {ICON} - isabelle.jedit.Main + isabelle.jedit.JEdit_Main {CLASSPATH} diff -r c9ee3028c125 -r e4d6b9bd5071 etc/build.props --- a/etc/build.props Mon Mar 21 11:40:11 2022 +0100 +++ b/etc/build.props Mon Mar 21 11:55:51 2022 +0100 @@ -1,6 +1,6 @@ title = Isabelle/Scala module = $ISABELLE_HOME/lib/classes/isabelle.jar -main = isabelle.jedit.Main +main = isabelle.jedit.JEdit_Main resources = \ lib/services/java.nio.charset.spi.CharsetProvider:META-INF/services/ \ lib/logo/isabelle_transparent-32.gif:isabelle/ \ @@ -246,6 +246,7 @@ src/Tools/jEdit/src/jedit_bibtex.scala \ src/Tools/jEdit/src/jedit_editor.scala \ src/Tools/jEdit/src/jedit_lib.scala \ + src/Tools/jEdit/src/jedit_main.scala \ src/Tools/jEdit/src/jedit_options.scala \ src/Tools/jEdit/src/jedit_plugins.scala \ src/Tools/jEdit/src/jedit_rendering.scala \ @@ -253,7 +254,6 @@ src/Tools/jEdit/src/jedit_sessions.scala \ src/Tools/jEdit/src/jedit_spell_checker.scala \ src/Tools/jEdit/src/keymap_merge.scala \ - src/Tools/jEdit/src/main.scala \ src/Tools/jEdit/src/main_plugin.scala \ src/Tools/jEdit/src/monitor_dockable.scala \ src/Tools/jEdit/src/output_dockable.scala \ diff -r c9ee3028c125 -r e4d6b9bd5071 src/Doc/System/Environment.thy --- a/src/Doc/System/Environment.thy Mon Mar 21 11:40:11 2022 +0100 +++ b/src/Doc/System/Environment.thy Mon Mar 21 11:55:51 2022 +0100 @@ -459,7 +459,7 @@ text \ The subsequent example creates a raw Java process on the command-line and invokes the main Isabelle application entry point: - @{verbatim [display] \isabelle_java -Djava.awt.headless=false isabelle.jedit.Main\} + @{verbatim [display] \isabelle_java -Djava.awt.headless=false isabelle.jedit.JEdit_Main\} \ diff -r c9ee3028c125 -r e4d6b9bd5071 src/Pure/Admin/build_release.scala --- a/src/Pure/Admin/build_release.scala Mon Mar 21 11:40:11 2022 +0100 +++ b/src/Pure/Admin/build_release.scala Mon Mar 21 11:55:51 2022 +0100 @@ -316,7 +316,7 @@ -classpath """" + classpath.map(p => "$ISABELLE_HOME/" + p.implode).mkString(":") + """" \ "-splash:$ISABELLE_HOME/lib/logo/isabelle.gif" \ """ + (if (dock_icon) """"-Xdock:icon=$ISABELLE_HOME/lib/logo/isabelle_transparent-128.png" \ -""" else "") + """isabelle.jedit.Main "$@" +""" else "") + """isabelle.jedit.JEdit_Main "$@" """ val script_path = isabelle_target + Path.explode("lib/scripts/Isabelle_app") File.write(script_path, script) diff -r c9ee3028c125 -r e4d6b9bd5071 src/Tools/jEdit/lib/Tools/jedit --- a/src/Tools/jEdit/lib/Tools/jedit Mon Mar 21 11:40:11 2022 +0100 +++ b/src/Tools/jEdit/lib/Tools/jedit Mon Mar 21 11:55:51 2022 +0100 @@ -164,5 +164,5 @@ JEDIT_INCLUDE_SESSIONS JEDIT_PRINT_MODE JEDIT_NO_BUILD JEDIT_BUILD_MODE export JEDIT_ML_PROCESS_POLICY="$ML_PROCESS_POLICY" exec isabelle java -splash:"$(platform_path "$ISABELLE_HOME/lib/logo/isabelle.gif")" \ - "${JAVA_ARGS[@]}" isabelle.jedit.Main "${ARGS[@]}" + "${JAVA_ARGS[@]}" isabelle.jedit.JEdit_Main "${ARGS[@]}" fi diff -r c9ee3028c125 -r e4d6b9bd5071 src/Tools/jEdit/src/jedit_main.scala --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/Tools/jEdit/src/jedit_main.scala Mon Mar 21 11:55:51 2022 +0100 @@ -0,0 +1,142 @@ +/* Title: src/Tools/jEdit/src/jedit_main.scala + Author: Makarius + +Main application entry point for Isabelle/jEdit. +*/ + +package isabelle.jedit + + +import isabelle._ + +import org.gjt.sp.jedit.{MiscUtilities, jEdit} + + +object JEdit_Main +{ + /* main entry point */ + + def main(args: Array[String]): Unit = + { + if (args.nonEmpty && args(0) == "-init") { + Isabelle_System.init() + } + else { + val start = + { + try { + Isabelle_System.init() + Isabelle_Fonts.init() + + GUI.init_lafs() + + + /* ROOTS template */ + + { + val roots = Path.explode("$ISABELLE_HOME_USER/ROOTS") + if (!roots.is_file) File.write(roots, """# Additional session root directories +# +# * each line contains one directory entry in Isabelle path notation, e.g. +# +# $ISABELLE_HOME/../AFP/thys +# +# for a copy of AFP put side-by-side to the Isabelle distribution +# +# * Isabelle/jEdit provides formal markup for C-hover-click and completion +# +# * lines starting with "#" are stripped +# +# * changes require restart of the Isabelle application +# +#:mode=text:encoding=UTF-8: + +#$ISABELLE_HOME/../AFP/thys +""") + } + + + /* settings directory */ + + val settings_dir = Path.explode("$JEDIT_SETTINGS") + + val properties = settings_dir + Path.explode("properties") + if (properties.is_file) { + val props1 = split_lines(File.read(properties)) + val props2 = props1.filterNot(_.startsWith("plugin-blacklist.isabelle_jedit")) + if (props1 != props2) File.write(properties, cat_lines(props2)) + } + + Isabelle_System.make_directory(settings_dir + Path.explode("DockableWindowManager")) + + if (!(settings_dir + Path.explode("perspective.xml")).is_file) { + File.write(settings_dir + Path.explode("DockableWindowManager/perspective-view0.xml"), + """""") + File.write(settings_dir + Path.explode("perspective.xml"), + XML.header + +""" + + + + +""") + } + + for (plugin <- Scala_Project.plugins) { plugin.context().build() } + + + /* args */ + + val jedit_settings = + "-settings=" + File.platform_path(Path.explode("$JEDIT_SETTINGS")) + + val jedit_server = + System.getProperty("isabelle.jedit_server") match { + case null | "" => "-noserver" + case name => "-server=" + name + } + + val jedit_options = + Isabelle_System.getenv_strict("JEDIT_OPTIONS").split(" +") + + val more_args = + { + args.toList.dropWhile(arg => arg.startsWith("-") && arg != "--") match { + case Nil | List("--") => + args ++ Array(File.platform_path(Path.explode("$USER_HOME/Scratch.thy"))) + case List(":") => args.slice(0, args.length - 1) + case _ => args + } + } + + + /* environment */ + + for (name <- List("ISABELLE_HOME", "ISABELLE_HOME_USER", "JEDIT_HOME", "JEDIT_SETTINGS")) { + MiscUtilities.putenv(name, File.platform_path(Isabelle_System.getenv(name))) + } + MiscUtilities.putenv("ISABELLE_ROOT", null) + + + /* properties */ + + System.setProperty("jedit.home", File.platform_path(Path.explode("$JEDIT_HOME"))) + System.setProperty("scala.home", File.platform_path(Path.explode("$SCALA_HOME"))) + System.setProperty("scala.color", "false") + + + /* main startup */ + + () => jEdit.main(Array(jedit_settings, jedit_server) ++ jedit_options ++ more_args) + } + catch { + case exn: Throwable => + GUI.init_laf() + GUI.dialog(null, "Isabelle", GUI.scrollable_text(Exn.message(exn))) + sys.exit(Process_Result.RC.failure) + } + } + start() + } + } +} diff -r c9ee3028c125 -r e4d6b9bd5071 src/Tools/jEdit/src/main.scala --- a/src/Tools/jEdit/src/main.scala Mon Mar 21 11:40:11 2022 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* Title: src/Tools/jEdit/src/main.scala - Author: Makarius - -Main Isabelle application entry point. -*/ - -package isabelle.jedit - - -import isabelle._ - -import org.gjt.sp.jedit.{MiscUtilities, jEdit} - - -object Main -{ - /* main entry point */ - - def main(args: Array[String]): Unit = - { - if (args.nonEmpty && args(0) == "-init") { - Isabelle_System.init() - } - else { - val start = - { - try { - Isabelle_System.init() - Isabelle_Fonts.init() - - GUI.init_lafs() - - - /* ROOTS template */ - - { - val roots = Path.explode("$ISABELLE_HOME_USER/ROOTS") - if (!roots.is_file) File.write(roots, """# Additional session root directories -# -# * each line contains one directory entry in Isabelle path notation, e.g. -# -# $ISABELLE_HOME/../AFP/thys -# -# for a copy of AFP put side-by-side to the Isabelle distribution -# -# * Isabelle/jEdit provides formal markup for C-hover-click and completion -# -# * lines starting with "#" are stripped -# -# * changes require restart of the Isabelle application -# -#:mode=text:encoding=UTF-8: - -#$ISABELLE_HOME/../AFP/thys -""") - } - - - /* settings directory */ - - val settings_dir = Path.explode("$JEDIT_SETTINGS") - - val properties = settings_dir + Path.explode("properties") - if (properties.is_file) { - val props1 = split_lines(File.read(properties)) - val props2 = props1.filterNot(_.startsWith("plugin-blacklist.isabelle_jedit")) - if (props1 != props2) File.write(properties, cat_lines(props2)) - } - - Isabelle_System.make_directory(settings_dir + Path.explode("DockableWindowManager")) - - if (!(settings_dir + Path.explode("perspective.xml")).is_file) { - File.write(settings_dir + Path.explode("DockableWindowManager/perspective-view0.xml"), - """""") - File.write(settings_dir + Path.explode("perspective.xml"), - XML.header + -""" - - - - -""") - } - - for (plugin <- Scala_Project.plugins) { plugin.context().build() } - - - /* args */ - - val jedit_settings = - "-settings=" + File.platform_path(Path.explode("$JEDIT_SETTINGS")) - - val jedit_server = - System.getProperty("isabelle.jedit_server") match { - case null | "" => "-noserver" - case name => "-server=" + name - } - - val jedit_options = - Isabelle_System.getenv_strict("JEDIT_OPTIONS").split(" +") - - val more_args = - { - args.toList.dropWhile(arg => arg.startsWith("-") && arg != "--") match { - case Nil | List("--") => - args ++ Array(File.platform_path(Path.explode("$USER_HOME/Scratch.thy"))) - case List(":") => args.slice(0, args.length - 1) - case _ => args - } - } - - - /* environment */ - - for (name <- List("ISABELLE_HOME", "ISABELLE_HOME_USER", "JEDIT_HOME", "JEDIT_SETTINGS")) { - MiscUtilities.putenv(name, File.platform_path(Isabelle_System.getenv(name))) - } - MiscUtilities.putenv("ISABELLE_ROOT", null) - - - /* properties */ - - System.setProperty("jedit.home", File.platform_path(Path.explode("$JEDIT_HOME"))) - System.setProperty("scala.home", File.platform_path(Path.explode("$SCALA_HOME"))) - System.setProperty("scala.color", "false") - - - /* main startup */ - - () => jEdit.main(Array(jedit_settings, jedit_server) ++ jedit_options ++ more_args) - } - catch { - case exn: Throwable => - GUI.init_laf() - GUI.dialog(null, "Isabelle", GUI.scrollable_text(Exn.message(exn))) - sys.exit(Process_Result.RC.failure) - } - } - start() - } - } -}