src/Pure/Admin/component_jedit.scala
author wenzelm
Tue, 22 Apr 2025 17:14:30 +0200
changeset 82559 ddcf31575146
parent 82552 f67ad2dbf6d5
child 82625 0fa6759948bc
permissions -rw-r--r--
more accurate GUI property (amending 49ca1a40c04a) -- requires to update jedit component;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
77566
2a99fcb283ee renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents: 76548
diff changeset
     1
/*  Title:      Pure/Admin/component_jedit.scala
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     3
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
     4
Build component for jEdit text-editor.
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     5
*/
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     6
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     7
package isabelle
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     8
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
     9
73983
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    10
import java.nio.charset.Charset
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    11
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    12
import scala.jdk.CollectionConverters._
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    13
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
    14
77566
2a99fcb283ee renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents: 76548
diff changeset
    15
object Component_JEdit {
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    16
  /* modes */
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    17
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75229
diff changeset
    18
  object Mode {
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    19
    val empty: Mode = new Mode("", "", Nil)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    20
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    21
    val init: Mode =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    22
      empty +
82121
fdaa32d96393 tuned: more robust Isabelle symbols;
wenzelm
parents: 82018
diff changeset
    23
        ("noWordSep" -> Symbol.decode("""_'?\<^sub>\^<>""")) +
82122
f67fb2339eeb more complete brackets for jEdit modes;
wenzelm
parents: 82121
diff changeset
    24
        ("unalignedOpenBrackets" -> Symbol.open_brackets_decoded) +
f67fb2339eeb more complete brackets for jEdit modes;
wenzelm
parents: 82121
diff changeset
    25
        ("unalignedCloseBrackets" -> Symbol.close_brackets_decoded) +
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    26
        ("tabSize" -> "2") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    27
        ("indentSize" -> "2")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    28
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75229
diff changeset
    29
    val list: List[Mode] = {
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    30
      val isabelle_news: Mode = init.define("isabelle-news", "Isabelle NEWS")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    31
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    32
      val isabelle: Mode =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    33
        init.define("isabelle", "Isabelle theory") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    34
          ("commentStart" -> "(*") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    35
          ("commentEnd" -> "*)")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    36
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    37
      val isabelle_ml: Mode = isabelle.define("isabelle-ml", "Isabelle/ML")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    38
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    39
      val isabelle_root: Mode = isabelle.define("isabelle-root", "Isabelle session root")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    40
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    41
      val isabelle_options: Mode = isabelle.define("isabelle-options", "Isabelle options")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    42
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    43
      val sml: Mode =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    44
        init.define("sml", "Standard ML") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    45
          ("commentStart" -> "(*") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    46
          ("commentEnd" -> "*)") +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    47
          ("noWordSep" -> "_'")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    48
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    49
      List(isabelle_news, isabelle, isabelle_ml, isabelle_root, isabelle_options, sml)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    50
    }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    51
  }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    52
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75229
diff changeset
    53
  final case class Mode private(name: String, description: String, rev_props: Properties.T) {
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    54
    override def toString: String = name
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    55
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    56
    def define(a: String, b: String): Mode = new Mode(a, b, rev_props)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    57
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    58
    def + (entry: Properties.Entry): Mode =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    59
      new Mode(name, description, Properties.put(rev_props, entry))
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    60
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75229
diff changeset
    61
    def write(dir: Path): Unit = {
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    62
      require(name.nonEmpty && description.nonEmpty, "Bad Isabelle/jEdit mode content")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    63
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    64
      val properties =
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    65
        rev_props.reverse.map(p =>
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    66
          Symbol.spaces(4) +
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    67
          XML.string_of_tree(XML.elem(Markup("PROPERTY", List("NAME" -> p._1, "VALUE" -> p._2)))))
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    68
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    69
      File.write(dir + Path.basic(name).xml,
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    70
"""<?xml version="1.0" encoding="UTF-8"?>
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    71
<!DOCTYPE MODE SYSTEM "xmode.dtd">
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    72
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    73
<!-- """ + XML.text(description) + """ mode -->
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    74
<MODE>
73665
9ab1d5fa84d0 tuned whitespace;
wenzelm
parents: 73660
diff changeset
    75
  <PROPS>""" + properties.mkString("\n", "\n", "") + """
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    76
  </PROPS>
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    77
</MODE>
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    78
""")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    79
    }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    80
  }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    81
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
    82
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    83
  /* build jEdit component */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    84
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    85
  private val download_jars: List[(String, String)] =
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    86
    List(
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    87
      "https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar" ->
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    88
      "jsr305-3.0.2.jar")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    89
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    90
  private val download_plugins: List[(String, String)] =
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    91
    List(
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    92
      "CommonControls" -> "1.7.4",
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    93
      "Console" -> "5.1.4",
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    94
      "ErrorList" -> "2.4.0",
74548
1861f4d1d3f9 updated to jEdit plugin Highlight 2.5;
wenzelm
parents: 74104
diff changeset
    95
      "Highlight" -> "2.5",
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    96
      "SideKick" -> "1.8")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
    97
74104
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
    98
  private def exclude_package(name: String): Boolean =
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
    99
    name.startsWith("de.masters_of_disaster.ant") ||
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   100
    name == "doclet" ||
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   101
    name == "installer"
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   102
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   103
  def build_jedit(
76518
b30b8e23383c clarified signature: more explicit types;
wenzelm
parents: 75906
diff changeset
   104
    component_path: Path,
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   105
    version: String,
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   106
    original: Boolean = false,
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75229
diff changeset
   107
    progress: Progress = new Progress
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75229
diff changeset
   108
  ): Unit = {
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   109
    Isabelle_System.require_command("ant", test = "-version")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   110
    Isabelle_System.require_command("patch")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   111
76547
9fe5d8c70352 tuned signature;
wenzelm
parents: 76540
diff changeset
   112
    val component_dir = Components.Directory(component_path).create(progress = progress)
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   113
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   114
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   115
    /* jEdit directory */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   116
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   117
    val jedit = "jedit" + version
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   118
    val jedit_patched = jedit + "-patched"
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   119
76518
b30b8e23383c clarified signature: more explicit types;
wenzelm
parents: 75906
diff changeset
   120
    val jedit_dir = Isabelle_System.make_directory(component_path + Path.basic(jedit))
b30b8e23383c clarified signature: more explicit types;
wenzelm
parents: 75906
diff changeset
   121
    val jedit_patched_dir = component_path + Path.basic(jedit_patched)
82180
1fad64843239 more accurate patch: change jEdit source directory and copy to installation directory;
wenzelm
parents: 82179
diff changeset
   122
    val source_dir = jedit_patched_dir + Path.basic("jEdit")
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   123
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 75229
diff changeset
   124
    def download_jedit(dir: Path, name: String, target_name: String = ""): Path = {
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   125
      val jedit_name = jedit + name
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   126
      val url =
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   127
        "https://sourceforge.net/projects/jedit/files/jedit/" +
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   128
          version + "/" + jedit_name + "/download"
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   129
      val path = dir + Path.basic(proper_string(target_name) getOrElse jedit_name)
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   130
      Isabelle_System.download_file(url, path, progress = progress)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   131
      path
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   132
    }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   133
75491
47d790984e82 tuned names;
wenzelm
parents: 75394
diff changeset
   134
    Isabelle_System.with_tmp_dir("build") { tmp_dir =>
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   135
      /* original version */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   136
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   137
      val install_path = download_jedit(tmp_dir, "install.jar")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   138
      Isabelle_System.bash("""export CLASSPATH=""
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   139
isabelle_java java -Duser.home=""" + File.bash_platform_path(tmp_dir) +
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   140
        " -jar " + File.bash_platform_path(install_path) + " auto " +
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   141
        File.bash_platform_path(jedit_dir) + " unix-script=off unix-man=off").check
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   142
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   143
      val source_path = download_jedit(tmp_dir, "source.tar.bz2")
76540
83de6e9ae983 clarified signature: prefer Scala functions instead of shell scripts;
wenzelm
parents: 76530
diff changeset
   144
      Isabelle_System.extract(source_path, jedit_dir)
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   145
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   146
82549
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   147
      /* tango icons (SVG) */
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   148
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   149
      val tango_path = Isabelle_System.make_directory(tmp_dir + Path.explode("tango"))
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   150
      Isabelle_System.download_file(
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   151
        "https://github.com/stephenc/tango-icon-theme/archive/41b8f6abd7eb.zip",
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   152
        tango_path.zip, progress = progress)
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   153
      Isabelle_System.extract(tango_path.zip, tango_path, strip = true)
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   154
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   155
82550
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   156
      /* IntelliJ IDEA icons (SVG) */
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   157
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   158
      val idea_path = Isabelle_System.make_directory(tmp_dir + Path.explode("idea"))
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   159
      Isabelle_System.download_file(
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   160
        "https://isabelle.sketis.net/components/idea-icons-20250415.tar.gz",
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   161
        idea_path.tar.gz, progress = progress)
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   162
      Isabelle_System.extract(idea_path.tar.gz, idea_path, strip = true)
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   163
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   164
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   165
      /* patched version */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   166
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   167
      Isabelle_System.copy_dir(jedit_dir, jedit_patched_dir)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   168
82179
wenzelm
parents: 82122
diff changeset
   169
      val source_org_dir = source_dir + Path.basic("org")
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   170
      val tmp_source_dir = tmp_dir + Path.basic("jEdit")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   171
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   172
      progress.echo("Patching jEdit sources ...")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   173
      for {
76527
63f9ffa1625f prefer deterministic result;
wenzelm
parents: 76518
diff changeset
   174
        file <- File.find_files(Path.explode("~~/src/Tools/jEdit/patches").file).sortBy(_.getName)
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   175
        name = file.getName
75906
2167b9e3157a clarified signature: support for adhoc file types;
wenzelm
parents: 75491
diff changeset
   176
        if !File.is_backup(name)
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   177
      } {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   178
        progress.bash("patch -p2 < " + File.bash_path(File.path(file)),
80224
db92e0b6a11a clarified signature: prefer symbolic isabelle.Path over physical java.io.File;
wenzelm
parents: 77566
diff changeset
   179
          cwd = source_dir, echo = true).check
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   180
      }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   181
82549
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   182
      progress.echo("Augmenting icons ...")
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   183
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   184
      val jedit_icons_path = source_dir + Path.explode("org/gjt/sp/jedit/icons/themes")
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   185
      val jedit_classic_path = jedit_icons_path + Path.basic("classic")
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   186
      val jedit_tango_path = jedit_icons_path + Path.basic("tango")
82550
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   187
      val jedit_idea_path = jedit_tango_path + Path.basic("idea-icons")
82549
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   188
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   189
      for (theme <- List(jedit_classic_path, jedit_tango_path)) {
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   190
        Isabelle_System.copy_file(Path.explode("~~/lib/logo/isabelle_transparent-32.gif"),
82549
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   191
          theme + Path.explode("32x32/apps/isabelle.gif"))
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   192
      }
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   193
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   194
      for {
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   195
        svg_file <- File.find_files(tango_path.file, pred = file => File.is_svg(file.getName))
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   196
        rel_path <- File.relative_path(tango_path, File.path(svg_file))
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   197
      } {
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   198
        val dir = Isabelle_System.make_directory(jedit_tango_path + rel_path.dir)
1abc4fc6a5f8 bundle SVG tango icons with jedit -- requires to update jedit component;
wenzelm
parents: 82422
diff changeset
   199
        Isabelle_System.copy_file(File.path(svg_file), dir + rel_path.base)
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   200
      }
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   201
82550
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   202
      Isabelle_System.extract(idea_path + Path.explode("jar/idea-icons.jar"), jedit_tango_path)
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   203
      Isabelle_System.rm_tree(jedit_tango_path + Path.explode("META-INF"))
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   204
      Isabelle_System.copy_file(idea_path + Path.explode("README"), jedit_idea_path)
6d5a169c3a22 bundle idea-icons-20250415 with jedit -- requires to update jedit component;
wenzelm
parents: 82549
diff changeset
   205
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   206
      progress.echo("Building jEdit ...")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   207
      Isabelle_System.copy_dir(source_dir, tmp_source_dir)
81449
d92d754b5dd9 removed obsolete option: jEdit 5.7.0 can be built with default jdk;
wenzelm
parents: 81427
diff changeset
   208
      progress.bash("ant", cwd = tmp_source_dir, echo = true).check
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   209
      Isabelle_System.copy_file(tmp_source_dir + Path.explode("build/jedit.jar"), jedit_patched_dir)
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   210
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   211
      val java_sources =
76527
63f9ffa1625f prefer deterministic result;
wenzelm
parents: 76518
diff changeset
   212
        (for {
82179
wenzelm
parents: 82122
diff changeset
   213
          file <- File.find_files(source_org_dir.file, file => File.is_java(file.getName))
74104
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   214
          package_name <- Scala_Project.package_name(File.path(file))
fa92c5f8af86 clarified jEdit java sources;
wenzelm
parents: 74057
diff changeset
   215
          if !exclude_package(package_name)
76527
63f9ffa1625f prefer deterministic result;
wenzelm
parents: 76518
diff changeset
   216
        } yield File.path(component_path.java_path.relativize(file.toPath).toFile).implode).sorted
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   217
76518
b30b8e23383c clarified signature: more explicit types;
wenzelm
parents: 75906
diff changeset
   218
      File.write(component_dir.build_props,
74057
22ad3ac2152c clarified properties: "module" and "no_build";
wenzelm
parents: 74030
diff changeset
   219
        "module = " + jedit_patched + "/jedit.jar\n" +
22ad3ac2152c clarified properties: "module" and "no_build";
wenzelm
parents: 74030
diff changeset
   220
        "no_build = true\n" +
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   221
        "requirements = env:JEDIT_JARS\n" +
75221
ea65e18c5614 tuned output;
wenzelm
parents: 75220
diff changeset
   222
        ("sources =" :: java_sources.sorted.map("  " + _)).mkString("", " \\\n", "\n"))
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   223
    }
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   224
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   225
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   226
    /* jars */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   227
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   228
    val jars_dir = Isabelle_System.make_directory(jedit_patched_dir + Path.basic("jars"))
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   229
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   230
    for { (url, name) <- download_jars } {
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   231
      Isabelle_System.download_file(url, jars_dir + Path.basic(name), progress = progress)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   232
    }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   233
82018
d104c6ad04ee suppress MacOS.jar from jEdit 5.7.0, following 65fd0f032a75;
wenzelm
parents: 81449
diff changeset
   234
    (jars_dir + Path.basic("MacOS.jar")).file.delete
d104c6ad04ee suppress MacOS.jar from jEdit 5.7.0, following 65fd0f032a75;
wenzelm
parents: 81449
diff changeset
   235
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   236
    for { (name, vers) <- download_plugins } {
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   237
      Isabelle_System.with_tmp_file("tmp", ext = "zip") { zip_path =>
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   238
        val url =
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   239
          "https://sourceforge.net/projects/jedit-plugins/files/" + name + "/" + vers + "/" +
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   240
            name + "-" + vers + "-bin.zip/download"
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   241
        Isabelle_System.download_file(url, zip_path, progress = progress)
76530
2bf13b30b98e clarified signature;
wenzelm
parents: 76527
diff changeset
   242
        Isabelle_System.extract(zip_path, jars_dir)
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   243
      }
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   244
    }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   245
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   246
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   247
    /* resources */
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   248
73983
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   249
    val keep_encodings = List("ISO-8859-1", "ISO-8859-15", "US-ASCII", "UTF-8", "windows-1252")
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   250
    val drop_encodings =
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   251
      Charset.availableCharsets().keySet().asScala.toList.sorted.filterNot(keep_encodings.contains)
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   252
82180
1fad64843239 more accurate patch: change jEdit source directory and copy to installation directory;
wenzelm
parents: 82179
diff changeset
   253
    File.write(source_dir + Path.explode("properties/jEdit.props"),
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   254
"""#jEdit properties
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   255
autoReloadDialog=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   256
buffer.deepIndent=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   257
buffer.encoding=UTF-8-Isabelle
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   258
buffer.indentSize=2
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   259
buffer.lineSeparator=\n
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   260
buffer.maxLineLen=100
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   261
buffer.noTabs=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   262
buffer.sidekick.keystroke-parse=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   263
buffer.tabSize=2
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   264
buffer.undoCount=1000
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   265
close-docking-area.shortcut2=C+e C+CIRCUMFLEX
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   266
complete-word.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   267
console.dock-position=floating
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   268
console.encoding=UTF-8
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   269
console.font=Isabelle DejaVu Sans Mono
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   270
console.fontsize=14
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   271
delete-line.shortcut=A+d
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   272
delete.shortcut2=C+d
73983
e2913fc81142 more systematic treatment of encodings;
wenzelm
parents: 73982
diff changeset
   273
""" + drop_encodings.map(a => "encoding.opt-out." + a + "=true").mkString("\n") + """
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   274
encodingDetectors=BOM XML-PI buffer-local-property
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   275
end.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   276
expand-abbrev.shortcut2=CA+SPACE
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   277
expand-folds.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   278
fallbackEncodings=UTF-8 ISO-8859-15 US-ASCII
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   279
firstTime=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   280
focus-buffer-switcher.shortcut2=A+CIRCUMFLEX
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   281
foldPainter=Circle
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   282
gatchan.highlight.overview=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   283
helpviewer.font=Isabelle DejaVu Serif
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   284
helpviewer.fontsize=12
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   285
home.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   286
hypersearch-results.dock-position=right
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   287
insert-newline-indent.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   288
insert-newline.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   289
isabelle-debugger.dock-position=floating
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   290
isabelle-documentation.dock-position=left
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   291
isabelle-export-browser.label=Browse theory exports
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   292
isabelle-output.dock-position=bottom
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   293
isabelle-output.height=174
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   294
isabelle-output.width=412
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   295
isabelle-query.dock-position=bottom
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   296
isabelle-session-browser.label=Browse session information
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   297
isabelle-simplifier-trace.dock-position=floating
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   298
isabelle-sledgehammer.dock-position=bottom
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   299
isabelle-state.dock-position=right
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   300
isabelle-symbols.dock-position=bottom
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   301
isabelle-theories.dock-position=right
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   302
isabelle.antiquoted_cartouche.label=Make antiquoted cartouche
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   303
isabelle.complete-word.label=Complete word
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   304
isabelle.complete.label=Complete Isabelle text
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   305
isabelle.complete.shortcut2=C+b
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   306
isabelle.control-bold.label=Control bold
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   307
isabelle.control-bold.shortcut=C+e RIGHT
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   308
isabelle.control-emph.label=Control emphasized
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   309
isabelle.control-emph.shortcut=C+e LEFT
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   310
isabelle.control-reset.label=Control reset
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   311
isabelle.control-reset.shortcut=C+e BACK_SPACE
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   312
isabelle.control-sub.label=Control subscript
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   313
isabelle.control-sub.shortcut=C+e DOWN
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   314
isabelle.control-sup.label=Control superscript
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   315
isabelle.control-sup.shortcut=C+e UP
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   316
isabelle.decrease-font-size.label=Decrease font size
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   317
isabelle.decrease-font-size.shortcut2=C+SUBTRACT
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   318
isabelle.decrease-font-size.shortcut=C+MINUS
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   319
isabelle.decrease-font-size2.label=Decrease font size (clone)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   320
isabelle.draft.label=Show draft in browser
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   321
isabelle.exclude-word-permanently.label=Exclude word permanently
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   322
isabelle.exclude-word.label=Exclude word
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   323
isabelle.first-error.label=Go to first error
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   324
isabelle.first-error.shortcut=CS+a
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   325
isabelle.goto-entity.label=Go to definition of formal entity at caret
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   326
isabelle.goto-entity.shortcut=CS+d
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   327
isabelle.include-word-permanently.label=Include word permanently
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   328
isabelle.include-word.label=Include word
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   329
isabelle.increase-font-size.label=Increase font size
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   330
isabelle.increase-font-size.shortcut2=C+ADD
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   331
isabelle.increase-font-size.shortcut=C+PLUS
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   332
isabelle.increase-font-size2.label=Increase font size (clone)
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   333
isabelle.increase-font-size2.shortcut=C+EQUALS
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   334
isabelle.java-monitor.label=Java/VM monitor
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   335
isabelle.last-error.label=Go to last error
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   336
isabelle.last-error.shortcut=CS+z
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   337
isabelle.message.label=Show message
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   338
isabelle.message.shortcut=CS+m
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   339
isabelle.newline.label=Newline with indentation of Isabelle keywords
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   340
isabelle.newline.shortcut=ENTER
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   341
isabelle.next-error.label=Go to next error
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   342
isabelle.next-error.shortcut=CS+n
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   343
isabelle.options.label=Isabelle options
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   344
isabelle.prev-error.label=Go to previous error
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   345
isabelle.prev-error.shortcut=CS+p
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   346
isabelle.preview.label=Show preview in browser
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   347
isabelle.reset-continuous-checking.label=Reset continuous checking
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   348
isabelle.reset-font-size.label=Reset font size
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   349
isabelle.reset-node-required.label=Reset node required
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   350
isabelle.reset-words.label=Reset non-permanent words
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   351
isabelle.select-entity.label=Select all occurences of formal entity at caret
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   352
isabelle.select-entity.shortcut=CS+ENTER
81300
42ff2b915b1d support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents: 81297
diff changeset
   353
isabelle.select-structure.label=Select structure around selection or caret
42ff2b915b1d support Isabelle/jEdit action isabelle.select_structure;
wenzelm
parents: 81297
diff changeset
   354
isabelle.select-structure.shortcut=C+7
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   355
isabelle.set-continuous-checking.label=Set continuous checking
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   356
isabelle.set-node-required.label=Set node required
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   357
isabelle.toggle-breakpoint.label=Toggle Breakpoint
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   358
isabelle.toggle-continuous-checking.label=Toggle continuous checking
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   359
isabelle.toggle-continuous-checking.shortcut=C+e ENTER
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   360
isabelle.toggle-node-required.label=Toggle node required
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   361
isabelle.toggle-node-required.shortcut=C+e SPACE
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   362
isabelle.tooltip.label=Show tooltip
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   363
isabelle.tooltip.shortcut=CS+b
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   364
isabelle.update-state.label=Update state output
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   365
isabelle.update-state.shortcut=S+ENTER
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   366
lang.usedefaultlocale=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   367
largefilemode=full
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   368
line-end.shortcut=END
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   369
line-home.shortcut=HOME
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   370
logo.icon.medium=32x32/apps/isabelle.gif
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   371
lookAndFeel=com.formdev.flatlaf.FlatLightLaf
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   372
match-bracket.shortcut2=C+9
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   373
metal.primary.font=Isabelle DejaVu Sans
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   374
metal.primary.fontsize=12
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   375
metal.secondary.font=Isabelle DejaVu Sans
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   376
metal.secondary.fontsize=12
82415
eaf11864fb71 prefer generic action names, to be injected into jEdit codebase eventually;
wenzelm
parents: 82412
diff changeset
   377
navigate-backwards.label=Navigate backwards
eaf11864fb71 prefer generic action names, to be injected into jEdit codebase eventually;
wenzelm
parents: 82412
diff changeset
   378
navigate-backwards.shortcut=AS+LEFT
eaf11864fb71 prefer generic action names, to be injected into jEdit codebase eventually;
wenzelm
parents: 82412
diff changeset
   379
navigate-forwards.label=Navigate forwards
eaf11864fb71 prefer generic action names, to be injected into jEdit codebase eventually;
wenzelm
parents: 82412
diff changeset
   380
navigate-forwards.shortcut=AS+RIGHT
82420
0fc508521b2a add navigation buttons to search bar, depending on property "navigate-toolbar" -- requires to update jedit component;
wenzelm
parents: 82415
diff changeset
   381
navigate-toolbar=navigate-backwards navigate-forwards
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   382
navigator.showOnToolbar=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   383
new-file-in-mode.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   384
next-bracket.shortcut2=C+e C+9
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   385
options.shortcuts.deletekeymap.label=Delete
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   386
options.shortcuts.duplicatekeymap.dialog.title=Keymap name
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   387
options.shortcuts.duplicatekeymap.label=Duplicate
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   388
options.shortcuts.resetkeymap.dialog.title=Reset keymap
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   389
options.shortcuts.resetkeymap.label=Reset
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   390
options.textarea.lineSpacing=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   391
plugin-blacklist.MacOSX.jar=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   392
plugin.MacOSXPlugin.altDispatcher=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   393
plugin.MacOSXPlugin.disableOption=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   394
prev-bracket.shortcut2=C+e C+8
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   395
print.font=Isabelle DejaVu Sans Mono
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   396
print.glyphVector=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   397
recent-buffer.shortcut2=C+CIRCUMFLEX
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   398
restore.remote=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   399
restore=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   400
search.subdirs.toggle=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   401
select-block.shortcut2=C+8
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   402
sidekick-tree.dock-position=right
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   403
sidekick.auto-complete-popup-get-focus=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   404
sidekick.buffer-save-parse=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   405
sidekick.complete-delay=0
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   406
sidekick.complete-instant.toggle=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   407
sidekick.complete-popup.accept-characters=\\t
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   408
sidekick.complete-popup.insert-characters=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   409
sidekick.persistentFilter=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   410
sidekick.showFilter=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   411
sidekick.splitter.location=721
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   412
systrayicon=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   413
tip.show=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   414
toggle-full-screen.shortcut2=S+F11
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   415
toggle-multi-select.shortcut2=C+NUMBER_SIGN
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   416
toggle-rect-select.shortcut2=A+NUMBER_SIGN
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   417
twoStageSave=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   418
vfs.browser.dock-position=left
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   419
vfs.favorite.0.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   420
vfs.favorite.0=$ISABELLE_HOME
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   421
vfs.favorite.1.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   422
vfs.favorite.1=$ISABELLE_HOME_USER
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   423
vfs.favorite.2.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   424
vfs.favorite.2=$JEDIT_HOME
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   425
vfs.favorite.3.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   426
vfs.favorite.3=$JEDIT_SETTINGS
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   427
vfs.favorite.4.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   428
vfs.favorite.4=isabelle-export:
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   429
vfs.favorite.5.type=1
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   430
vfs.favorite.5=isabelle-session:
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   431
view.antiAlias=subpixel HRGB
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   432
view.blockCaret=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   433
view.caretBlink=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   434
view.docking.framework=PIDE
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   435
view.eolMarkers=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   436
view.extendedState=0
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   437
view.font=Isabelle DejaVu Sans Mono
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   438
view.fontsize=18
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   439
view.fracFontMetrics=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   440
view.gutter.font=Isabelle DejaVu Sans Mono
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   441
view.gutter.fontsize=12
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   442
view.gutter.lineNumbers=false
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   443
view.gutter.selectionAreaWidth=18
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   444
view.height=850
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   445
view.middleMousePaste=true
82421
b684876ab760 prefer search bar (with navigation buttons) over old-fashioned tool bar -- requires to update jedit component;
wenzelm
parents: 82420
diff changeset
   446
view.showSearchbar=true
b684876ab760 prefer search bar (with navigation buttons) over old-fashioned tool bar -- requires to update jedit component;
wenzelm
parents: 82420
diff changeset
   447
view.showToolbar=false
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   448
view.status.memory.background=#666699
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   449
view.status=( mode , fold , encoding ) locked wrap multiSelect rectSelect overwrite lineSep buffersets task-monitor java-status ml-status errors clock
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   450
view.thickCaret=true
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   451
view.width=1200
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   452
xml-insert-closing-tag.shortcut=
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   453
""")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   454
82180
1fad64843239 more accurate patch: change jEdit source directory and copy to installation directory;
wenzelm
parents: 82179
diff changeset
   455
    val modes_dir = source_dir + Path.basic("modes")
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   456
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   457
    Mode.list.foreach(_.write(modes_dir))
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   458
75202
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   459
    File.change_lines(modes_dir + Path.basic("catalog")) { _.flatMap(line =>
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   460
      if (line.containsSlice("FILE=\"ml.xml\"") ||
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   461
        line.containsSlice("FILE_NAME_GLOB=\"*.{sml,ml}\"") ||
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   462
        line.containsSlice("FILE_NAME_GLOB=\"*.ftl\"")) Nil
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   463
      else if (line.containsSlice("NAME=\"jamon\"")) {
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   464
        List(
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   465
          """<MODE NAME="isabelle" FILE="isabelle.xml" FILE_NAME_GLOB="{*.thy,ROOT0.ML,ROOT.ML}"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   466
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   467
          """<MODE NAME="isabelle-ml" FILE="isabelle-ml.xml" FILE_NAME_GLOB="*.ML"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   468
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   469
          """<MODE NAME="isabelle-news" FILE="isabelle-news.xml"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   470
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   471
          """<MODE NAME="isabelle-options" FILE="isabelle-options.xml"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   472
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   473
          """<MODE NAME="isabelle-root" FILE="isabelle-root.xml" FILE_NAME_GLOB="ROOT"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   474
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   475
          line)
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   476
      }
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   477
      else if (line.containsSlice("NAME=\"sqr\"")) {
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   478
        List(
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   479
          """<MODE NAME="sml" FILE="sml.xml" FILE_NAME_GLOB="*.{sml,sig}"/>""",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   480
          "",
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   481
          line)
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   482
      }
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   483
      else List(line))
4fdde010086f clarified signature;
wenzelm
parents: 74660
diff changeset
   484
    }
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   485
82180
1fad64843239 more accurate patch: change jEdit source directory and copy to installation directory;
wenzelm
parents: 82179
diff changeset
   486
    for (name <- List("keymaps", "macros", "modes", "properties", "startup")) {
1fad64843239 more accurate patch: change jEdit source directory and copy to installation directory;
wenzelm
parents: 82179
diff changeset
   487
      val path = Path.explode(name)
1fad64843239 more accurate patch: change jEdit source directory and copy to installation directory;
wenzelm
parents: 82179
diff changeset
   488
      Isabelle_System.rm_tree(jedit_patched_dir + path)
1fad64843239 more accurate patch: change jEdit source directory and copy to installation directory;
wenzelm
parents: 82179
diff changeset
   489
      Isabelle_System.copy_dir(source_dir + path, jedit_patched_dir)
1fad64843239 more accurate patch: change jEdit source directory and copy to installation directory;
wenzelm
parents: 82179
diff changeset
   490
    }
1fad64843239 more accurate patch: change jEdit source directory and copy to installation directory;
wenzelm
parents: 82179
diff changeset
   491
73660
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   492
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   493
    /* doc */
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   494
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   495
    val doc_dir = jedit_patched_dir + Path.basic("doc")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   496
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   497
    download_jedit(doc_dir, "manual-a4.pdf", target_name = "jedit-manual.pdf")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   498
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   499
    Isabelle_System.copy_file(
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   500
      doc_dir + Path.basic("CHANGES.txt"), doc_dir + Path.basic("jedit-changes"))
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   501
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   502
    File.write(doc_dir + Path.basic("Contents"),
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   503
"""Original jEdit Documentation
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   504
  jedit-manual    jEdit User's Guide
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   505
  jedit-changes   jEdit Version History
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   506
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   507
""")
ff716ecb0805 put more resources into jedit_build component;
wenzelm
parents: 73653
diff changeset
   508
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   509
75229
075467e070ba tuned signature;
wenzelm
parents: 75221
diff changeset
   510
    /* make patch */
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   511
76518
b30b8e23383c clarified signature: more explicit types;
wenzelm
parents: 75906
diff changeset
   512
    File.write(component_path + Path.basic(jedit).patch,
b30b8e23383c clarified signature: more explicit types;
wenzelm
parents: 75906
diff changeset
   513
      Isabelle_System.make_patch(component_path, Path.basic(jedit), Path.basic(jedit_patched)))
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   514
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   515
    if (!original) Isabelle_System.rm_tree(jedit_dir)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   516
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   517
74030
39e05601faeb more accurate scala_project, based on build.props of components;
wenzelm
parents: 73987
diff changeset
   518
    /* settings */
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   519
81427
ecd62f7b3644 performance tuning for macOS (after update of "jedit" component): old OpenGL works better for text rendering;
wenzelm
parents: 81300
diff changeset
   520
    // see also https://docs.oracle.com/en/java/javase/21/troubleshoot/java-2d-properties.html
ecd62f7b3644 performance tuning for macOS (after update of "jedit" component): old OpenGL works better for text rendering;
wenzelm
parents: 81300
diff changeset
   521
76548
0af64cc2eee9 tuned signature;
wenzelm
parents: 76547
diff changeset
   522
    component_dir.write_settings("""
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   523
JEDIT_HOME="$COMPONENT/""" + jedit_patched + """"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   524
JEDIT_JARS=""" + quote(File.read_dir(jars_dir).map("$JEDIT_HOME/jars/" + _).mkString(":")) + """
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   525
JEDIT_JAR="$JEDIT_HOME/jedit.jar"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   526
classpath "$JEDIT_JAR"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   527
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   528
JEDIT_SETTINGS="$ISABELLE_HOME_USER/jedit"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   529
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   530
ISABELLE_DOCS="$ISABELLE_DOCS:$JEDIT_HOME/doc"
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73983
diff changeset
   531
""")
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   532
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   533
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   534
    /* README */
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   535
76518
b30b8e23383c clarified signature: more explicit types;
wenzelm
parents: 75906
diff changeset
   536
    File.write(component_dir.README,
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   537
"""This is a slightly patched version of jEdit """ + version + """ from
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   538
https://sourceforge.net/projects/jedit/files/jedit with some
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   539
additional plugins jars from
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   540
https://sourceforge.net/projects/jedit-plugins/files
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   541
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   542
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   543
        Makarius
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   544
        """ + Date.Format.date(Date.now()) + "\n")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   545
  }
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   546
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   547
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   548
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   549
  /** Isabelle tool wrappers **/
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   550
81297
07f64697408e update to jedit5.7.0;
wenzelm
parents: 80224
diff changeset
   551
  val default_version = "5.7.0"
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   552
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   553
  val isabelle_tool =
77566
2a99fcb283ee renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents: 76548
diff changeset
   554
    Isabelle_Tool("component_jedit", "build Isabelle component from the jEdit text-editor",
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   555
      Scala_Project.here,
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   556
      { args =>
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   557
        var target_dir = Path.current
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   558
        var original = false
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   559
        var version = default_version
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   560
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   561
        val getopts = Getopts("""
77566
2a99fcb283ee renamed administrative tools to build Isabelle components (unrelated to "isabelle build");
wenzelm
parents: 76548
diff changeset
   562
Usage: isabelle component_jedit [OPTIONS]
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   563
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   564
  Options are:
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   565
    -D DIR       target directory (default ".")
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   566
    -O           retain copy of original jEdit directory
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   567
    -V VERSION   jEdit version (default: """ + quote(default_version) + """)
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   568
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   569
  Build auxiliary jEdit component from original sources, with some patches.
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   570
""",
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   571
          "D:" -> (arg => target_dir = Path.explode(arg)),
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   572
          "O" -> (_ => original = true),
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   573
          "V:" -> (arg => version = arg))
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   574
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   575
        val more_args = getopts(args)
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   576
        if (more_args.nonEmpty) getopts.usage()
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   577
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   578
        val component_dir = target_dir + Path.basic("jedit-" + Date.Format.alt_date(Date.now()))
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   579
        val progress = new Console_Progress()
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   580
81449
d92d754b5dd9 removed obsolete option: jEdit 5.7.0 can be built with default jdk;
wenzelm
parents: 81427
diff changeset
   581
        build_jedit(component_dir, version, original = original, progress = progress)
75394
42267c650205 tuned formatting;
wenzelm
parents: 75393
diff changeset
   582
      })
73653
d9823224fcfe build auxiliary jEdit component in Isabelle/Scala;
wenzelm
parents:
diff changeset
   583
}