src/Doc/JEdit/JEdit.thy
author wenzelm
Fri, 15 Jan 2016 16:04:09 +0100
changeset 62183 7fdcc25c5c35
parent 62154 b855771b3979
child 62184 3764797dd6fc
permissions -rw-r--r--
misc updates and tuning;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
61656
cfabbc083977 more uniform jEdit properties;
wenzelm
parents: 61574
diff changeset
     1
(*:maxLineLen=78:*)
53981
1f4d6870b7b2 more on text completion;
wenzelm
parents: 53886
diff changeset
     2
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     3
theory JEdit
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     4
imports Base
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     5
begin
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     6
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
     7
chapter \<open>Introduction\<close>
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
     8
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
     9
section \<open>Concepts and terminology\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    10
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
    11
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    12
  Isabelle/jEdit is a Prover IDE that integrates \<^emph>\<open>parallel proof checking\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    13
  @{cite "Wenzel:2009" and "Wenzel:2013:ITP"} with \<^emph>\<open>asynchronous user
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    14
  interaction\<close> @{cite "Wenzel:2010" and "Wenzel:2012:UITP-EPTCS" and
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    15
  "Wenzel:2014:ITP-PIDE" and "Wenzel:2014:UITP"}, based on a document-oriented
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    16
  approach to \<^emph>\<open>continuous proof processing\<close> @{cite "Wenzel:2011:CICM" and
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    17
  "Wenzel:2012"}. Many concepts and system components are fit together in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    18
  order to make this work. The main building blocks are as follows.
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
    19
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    20
    \<^descr>[Isabelle/ML] is the implementation and extension language of Isabelle,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    21
    see also @{cite "isabelle-implementation"}. It is integrated into the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    22
    logical context of Isabelle/Isar and allows to manipulate logical entities
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    23
    directly. Arbitrary add-on tools may be implemented for object-logics such
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    24
    as Isabelle/HOL.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    25
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    26
    \<^descr>[Isabelle/Scala] is the system programming language of Isabelle. It
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    27
    extends the pure logical environment of Isabelle/ML towards the outer
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    28
    world of graphical user interfaces, text editors, IDE frameworks, web
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    29
    services etc. Special infrastructure allows to transfer algebraic
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    30
    datatypes and formatted text easily between ML and Scala, using
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    31
    asynchronous protocol commands.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
    32
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    33
    \<^descr>[PIDE] is a general framework for Prover IDEs based on Isabelle/Scala. It
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    34
    is built around a concept of parallel and asynchronous document
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    35
    processing, which is supported natively by the parallel proof engine that
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    36
    is implemented in Isabelle/ML. The traditional prover command loop is
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    37
    given up; instead there is direct support for editing of source text, with
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    38
    rich formal markup for GUI rendering.
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    39
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    40
    \<^descr>[jEdit] is a sophisticated text editor\<^footnote>\<open>@{url "http://www.jedit.org"}\<close>
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    41
    implemented in Java\<^footnote>\<open>@{url "http://www.java.com"}\<close>. It is easily
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    42
    extensible by plugins written in any language that works on the JVM. In
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    43
    the context of Isabelle this is always Scala\<^footnote>\<open>@{url
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    44
    "http://www.scala-lang.org"}\<close>.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    45
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    46
    \<^descr>[Isabelle/jEdit] is the main application of the PIDE framework and the
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    47
    default user-interface for Isabelle. It targets both beginners and
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    48
    experts. Technically, Isabelle/jEdit consists of the original jEdit code
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    49
    base with minimal patches and a special plugin for Isabelle. This is
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    50
    integrated as a desktop application for the main operating system
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    51
    families: Linux, Windows, Mac OS X.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    52
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    53
  End-users of Isabelle download and run a standalone application that exposes
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    54
  jEdit as a text editor on the surface. Thus there is occasionally a tendency
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    55
  to apply the name ``jEdit'' to any of the Isabelle Prover IDE aspects,
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    56
  without proper differentiation. When discussing these PIDE building blocks
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    57
  in public forums, mailing lists, or even scientific publications, it is
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    58
  particularly important to distinguish Isabelle/ML versus Standard ML,
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    59
  Isabelle/Scala versus Scala, Isabelle/jEdit versus jEdit.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
    60
\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    61
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    62
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
    63
section \<open>The Isabelle/jEdit Prover IDE\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    64
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
    65
text \<open>
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    66
  \begin{figure}[!htb]
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
    67
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
    68
  \includegraphics[scale=0.333]{isabelle-jedit}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
    69
  \end{center}
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
    70
  \caption{The Isabelle/jEdit Prover IDE}
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
    71
  \label{fig:isabelle-jedit}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
    72
  \end{figure}
53773
36703fcea740 added canonical screenshot;
wenzelm
parents: 53771
diff changeset
    73
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    74
  Isabelle/jEdit (\figref{fig:isabelle-jedit}) consists of some plugins for
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    75
  the jEdit text editor, while preserving its general look-and-feel as far as
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    76
  possible. The main plugin is called ``Isabelle'' and has its own menu
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
    77
  \<^emph>\<open>Plugins~/ Isabelle\<close> with access to several panels (see also
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    78
  \secref{sec:dockables}), as well as \<^emph>\<open>Plugins~/ Plugin Options~/ Isabelle\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    79
  (see also \secref{sec:options}).
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
    80
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    81
  The options allow to specify a logic session name, but the same selector is
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    82
  also accessible in the \<^emph>\<open>Theories\<close> panel (\secref{sec:theories}). After
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    83
  application startup, the selected logic session image is provided
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    84
  automatically by the Isabelle build tool @{cite "isabelle-system"}: if it is
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    85
  absent or outdated wrt.\ its sources, the build process updates it while the
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    86
  text editor is running. Prover IDE functionality is only activated after
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    87
  successful termination of the build process. A failure may require changing
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    88
  some options and restart the application. Changing the logic session, or the
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    89
  underlying ML system platform (32\,bit versus 64\,bit) requires a restart of
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
    90
  the application to take effect.
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
    91
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
    92
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    93
  The main job of the Prover IDE is to manage sources and their changes,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    94
  taking the logical structure as a formal document into account (see also
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
    95
  \secref{sec:document-model}). The editor and the prover are connected
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    96
  asynchronously in a lock-free manner. The prover is free to organize the
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    97
  checking of the formal text in parallel on multiple cores, and provides
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
    98
  feedback via markup, which is rendered in the editor via colors, boxes,
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
    99
  squiggly underlines, hyperlinks, popup windows, icons, clickable output etc.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
   100
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   101
  Using the mouse together with the modifier key \<^verbatim>\<open>CONTROL\<close> (Linux, Windows)
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   102
  or \<^verbatim>\<open>COMMAND\<close> (Mac OS X) exposes formal content via tooltips and/or
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   103
  hyperlinks (see also \secref{sec:tooltips-hyperlinks}). Output (in popups
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   104
  etc.) may be explored recursively, using the same techniques as in the
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   105
  editor source buffer.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
   106
57337
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
   107
  Thus the Prover IDE gives an impression of direct access to formal content
8b46b57008ea misc tuning;
wenzelm
parents: 57336
diff changeset
   108
  of the prover within the editor, but in reality only certain aspects are
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   109
  exposed, according to the possibilities of the prover and its add-on tools.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   110
\<close>
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
   111
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
   112
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   113
subsection \<open>Documentation\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   114
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   115
text \<open>
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   116
  The \<^emph>\<open>Documentation\<close> panel of Isabelle/jEdit provides access to some example
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   117
  theory files and the standard Isabelle documentation. PDF files are opened
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   118
  by regular desktop operations of the underlying platform. The section
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   119
  ``Original jEdit Documentation'' contains the original \<^emph>\<open>User's Guide\<close> of
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   120
  this sophisticated text editor. The same is accessible via the \<^verbatim>\<open>Help\<close> menu
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   121
  or \<^verbatim>\<open>F1\<close> keyboard shortcut, using the built-in HTML viewer of Java/Swing.
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   122
  The latter also includes \<^emph>\<open>Frequently Asked Questions\<close> and documentation of
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   123
  individual plugins.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   124
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   125
  Most of the information about jEdit is relevant for Isabelle/jEdit as well,
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   126
  but one needs to keep in mind that defaults sometimes differ, and the
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   127
  official jEdit documentation does not know about the Isabelle plugin with
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   128
  its support for continuous checking of formal source text: jEdit is a plain
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   129
  text editor, but Isabelle/jEdit is a Prover IDE.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   130
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   131
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   132
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   133
subsection \<open>Plugins\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   134
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   135
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   136
  The \<^emph>\<open>Plugin Manager\<close> of jEdit allows to augment editor functionality by JVM
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   137
  modules (jars) that are provided by the central plugin repository, which is
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   138
  accessible via various mirror sites.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   139
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   140
  Connecting to the plugin server-infrastructure of the jEdit project allows
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   141
  to update bundled plugins or to add further functionality. This needs to be
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   142
  done with the usual care for such an open bazaar of contributions. Arbitrary
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   143
  combinations of add-on features are apt to cause problems. It is advisable
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   144
  to start with the default configuration of Isabelle/jEdit and develop some
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   145
  understanding how it is supposed to work, before loading too many other
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   146
  plugins.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   147
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   148
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   149
  The main \<^emph>\<open>Isabelle\<close> plugin is an integral part of Isabelle/jEdit and needs
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   150
  to remain active at all times! A few additional plugins are bundled with
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   151
  Isabelle/jEdit for convenience or out of necessity, notably \<^emph>\<open>Console\<close> with
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   152
  its Isabelle/Scala sub-plugin (\secref{sec:scala-console}) and \<^emph>\<open>SideKick\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   153
  with some Isabelle-specific parsers for document tree structure
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   154
  (\secref{sec:sidekick}). The \<^emph>\<open>Navigator\<close> plugin is particularly important
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   155
  for hyperlinks within the formal document-model
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   156
  (\secref{sec:tooltips-hyperlinks}). Further plugins (e.g.\ \<^emph>\<open>ErrorList\<close>,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   157
  \<^emph>\<open>Code2HTML\<close>) are included to saturate the dependencies of bundled plugins,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   158
  but have no particular use in Isabelle/jEdit.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   159
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   160
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   161
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   162
subsection \<open>Options \label{sec:options}\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   163
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   164
text \<open>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   165
  Both jEdit and Isabelle have distinctive management of persistent options.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   166
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   167
  Regular jEdit options are accessible via the dialogs \<^emph>\<open>Utilities~/ Global
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   168
  Options\<close> or \<^emph>\<open>Plugins~/ Plugin Options\<close>, with a second chance to flip the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   169
  two within the central options dialog. Changes are stored in
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   170
  @{file_unchecked "$ISABELLE_HOME_USER/jedit/properties"} and
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   171
  @{file_unchecked "$ISABELLE_HOME_USER/jedit/keymaps"}.
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   172
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   173
  Isabelle system options are managed by Isabelle/Scala and changes are stored
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   174
  in @{file_unchecked "$ISABELLE_HOME_USER/etc/preferences"}, independently of
60270
wenzelm
parents: 60264
diff changeset
   175
  other jEdit properties. See also @{cite "isabelle-system"}, especially the
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   176
  coverage of sessions and command-line tools like @{tool build} or @{tool
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   177
  options}.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   178
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   179
  Those Isabelle options that are declared as \<^verbatim>\<open>public\<close> are configurable in
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   180
  Isabelle/jEdit via \<^emph>\<open>Plugin Options~/ Isabelle~/ General\<close>. Moreover, there
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   181
  are various options for rendering of document content, which are
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   182
  configurable via \<^emph>\<open>Plugin Options~/ Isabelle~/ Rendering\<close>. Thus \<^emph>\<open>Plugin
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   183
  Options~/ Isabelle\<close> in jEdit provides a view on a subset of Isabelle system
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   184
  options. Note that some of these options affect general parameters that are
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   185
  relevant outside Isabelle/jEdit as well, e.g.\ @{system_option threads} or
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   186
  @{system_option parallel_proofs} for the Isabelle build tool @{cite
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   187
  "isabelle-system"}, but it is possible to use the settings variable
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   188
  @{setting ISABELLE_BUILD_OPTIONS} to change defaults for batch builds
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   189
  without affecting the Prover IDE.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
   190
57627
65fc7ae1bf66 added action "isabelle.options" (despite problems with initial window size);
wenzelm
parents: 57603
diff changeset
   191
  The jEdit action @{action_def isabelle.options} opens the options dialog for
65fc7ae1bf66 added action "isabelle.options" (despite problems with initial window size);
wenzelm
parents: 57603
diff changeset
   192
  the Isabelle plugin; it can be mapped to editor GUI elements as usual.
65fc7ae1bf66 added action "isabelle.options" (despite problems with initial window size);
wenzelm
parents: 57603
diff changeset
   193
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   194
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   195
  Options are usually loaded on startup and saved on shutdown of
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   196
  Isabelle/jEdit. Editing the machine-generated @{file_unchecked
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   197
  "$ISABELLE_HOME_USER/jedit/properties"} or @{file_unchecked
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   198
  "$ISABELLE_HOME_USER/etc/preferences"} manually while the application is
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   199
  running is likely to cause surprise due to lost update!
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   200
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   201
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   202
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   203
subsection \<open>Keymaps\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   204
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   205
text \<open>
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   206
  Keyboard shortcuts are managed as a separate concept of \<^emph>\<open>keymap\<close> that is
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   207
  configurable via \<^emph>\<open>Global Options~/ Shortcuts\<close>. The \<^verbatim>\<open>imported\<close> keymap is
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   208
  derived from the initial environment of properties that is available at the
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   209
  first start of the editor; afterwards the keymap file takes precedence and
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   210
  is no longer affected by change of default properties.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   211
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   212
  This subtle difference of jEdit keymaps versus properties is relevant for
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   213
  Isabelle/jEdit due to various fine-tuning of global defaults, with
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   214
  additional keyboard shortcuts for Isabelle-specific functionality. Users may
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   215
  change their keymap later, but need to copy some keyboard shortcuts manually
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   216
  (see also @{file_unchecked "$ISABELLE_HOME_USER/jedit/keymaps"} versus
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   217
  \<^verbatim>\<open>shortcut\<close> properties in @{file
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   218
  "$ISABELLE_HOME/src/Tools/jEdit/src/jEdit.props"}).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   219
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   220
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   221
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   222
section \<open>Command-line invocation \label{sec:command-line}\<close>
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   223
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   224
text \<open>
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   225
  Isabelle/jEdit is normally invoked as a single-instance desktop application,
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   226
  based on platform-specific executables for Linux, Windows, Mac OS X.
62014
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   227
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   228
  It is also possible to invoke the Prover IDE on the command-line, with some
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   229
  extra options and environment settings. The command-line usage of @{tool_def
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   230
  jedit} is as follows:
61408
9020a3ba6c9a @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61199
diff changeset
   231
  @{verbatim [display]
9020a3ba6c9a @{verbatim [display]} supersedes old alltt/ttbox;
wenzelm
parents: 61199
diff changeset
   232
\<open>Usage: isabelle jedit [OPTIONS] [FILES ...]
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   233
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   234
  Options are:
62039
a77f4a9037d4 clarified isabelle jedit command-line;
wenzelm
parents: 62036
diff changeset
   235
    -D NAME=X    set JVM system property
61132
70029aae9a9f clarified JEDIT_JAVA_SYSTEM_OPTIONS;
wenzelm
parents: 60296
diff changeset
   236
    -J OPTION    add JVM runtime option
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   237
    -b           build only
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   238
    -d DIR       include session directory
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   239
    -f           fresh build
61132
70029aae9a9f clarified JEDIT_JAVA_SYSTEM_OPTIONS;
wenzelm
parents: 60296
diff changeset
   240
    -j OPTION    add jEdit runtime option
70029aae9a9f clarified JEDIT_JAVA_SYSTEM_OPTIONS;
wenzelm
parents: 60296
diff changeset
   241
    -l NAME      logic image name
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   242
    -m MODE      add print mode for output
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   243
    -n           no build of session image on startup
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   244
    -s           system build mode for session image
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   245
61512
933463440449 more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents: 61506
diff changeset
   246
  Start jEdit with Isabelle plugin setup and open FILES
933463440449 more uniform command-line for "isabelle jedit" and the isabelle.Main app wrapper;
wenzelm
parents: 61506
diff changeset
   247
  (default "$USER_HOME/Scratch.thy" or ":" for empty buffer).\<close>}
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   248
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   249
  The \<^verbatim>\<open>-l\<close> option specifies the session name of the logic image to be used
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   250
  for proof processing. Additional session root directories may be included
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   251
  via option \<^verbatim>\<open>-d\<close> to augment that name space of @{tool build} @{cite
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   252
  "isabelle-system"}.
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   253
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   254
  By default, the specified image is checked and built on demand. The \<^verbatim>\<open>-s\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   255
  option determines where to store the result session image of @{tool build}.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   256
  The \<^verbatim>\<open>-n\<close> option bypasses the implicit build process for the selected
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   257
  session image.
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   258
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   259
  The \<^verbatim>\<open>-m\<close> option specifies additional print modes for the prover process.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   260
  Note that the system option @{system_option_ref jedit_print_mode} allows to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   261
  do the same persistently (e.g.\ via the \<^emph>\<open>Plugin Options\<close> dialog of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   262
  Isabelle/jEdit), without requiring command-line invocation.
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   263
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   264
  The \<^verbatim>\<open>-J\<close> and \<^verbatim>\<open>-j\<close> options allow to pass additional low-level options to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   265
  the JVM or jEdit, respectively. The defaults are provided by the Isabelle
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   266
  settings environment @{cite "isabelle-system"}, but note that these only
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   267
  work for the command-line tool described here, and not the regular
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   268
  application.
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   269
62039
a77f4a9037d4 clarified isabelle jedit command-line;
wenzelm
parents: 62036
diff changeset
   270
  The \<^verbatim>\<open>-D\<close> option allows to define JVM system properties; this is passed
a77f4a9037d4 clarified isabelle jedit command-line;
wenzelm
parents: 62036
diff changeset
   271
  directly to the underlying \<^verbatim>\<open>java\<close> process.
a77f4a9037d4 clarified isabelle jedit command-line;
wenzelm
parents: 62036
diff changeset
   272
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   273
  The \<^verbatim>\<open>-b\<close> and \<^verbatim>\<open>-f\<close> options control the self-build mechanism of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   274
  Isabelle/jEdit. This is only relevant for building from sources, which also
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   275
  requires an auxiliary \<^verbatim>\<open>jedit_build\<close> component from @{url
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   276
  "http://isabelle.in.tum.de/components"}. The official Isabelle release
62014
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   277
  already includes a pre-built version of Isabelle/jEdit.
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   278
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   279
  \<^bigskip>
62014
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   280
  It is also possible to connect to an already running Isabelle/jEdit process
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   281
  via @{tool_def jedit_client}:
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   282
  @{verbatim [display]
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   283
\<open>Usage: isabelle jedit_client [OPTIONS] [FILES ...]
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   284
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   285
  Options are:
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   286
    -c           only check presence of server
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   287
    -n           only report server name
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   288
    -s NAME      server name (default Isabelle)
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   289
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   290
  Connect to already running Isabelle/jEdit instance and open FILES\<close>}
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   291
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   292
  The \<^verbatim>\<open>-c\<close> option merely checks the presence of the server, producing a
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   293
  process return code accordingly.
62014
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   294
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   295
  The \<^verbatim>\<open>-n\<close> option reports the server name, and the \<^verbatim>\<open>-s\<close> option provides a
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   296
  different server name. The default server name is the official distribution
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   297
  name (e.g.\ \<^verbatim>\<open>Isabelle2016\<close>). Thus @{tool jedit_client} can connect to the
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   298
  Isabelle desktop application without further options.
62014
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   299
62036
773cb226738c provide server name uniformly on all platforms;
wenzelm
parents: 62014
diff changeset
   300
  The JVM system property \<^verbatim>\<open>isabelle.jedit_server\<close> provides a different server
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   301
  name, e.g.\ use \<^verbatim>\<open>isabelle jedit -Disabelle.jedit_server=\<close>\<open>name\<close> and
62036
773cb226738c provide server name uniformly on all platforms;
wenzelm
parents: 62014
diff changeset
   302
  \<^verbatim>\<open>isabelle jedit_client -s\<close>~\<open>name\<close> to connect later on.
62014
446fcbadc6bf documentation for "isabelle jedit_client";
wenzelm
parents: 61960
diff changeset
   303
\<close>
57320
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   304
00f2c8d1aa0b more on command-line invocation -- moved material from system manual;
wenzelm
parents: 57319
diff changeset
   305
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   306
section \<open>GUI rendering\<close>
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   307
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   308
subsection \<open>Look-and-feel \label{sec:look-and-feel}\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   309
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   310
text \<open>
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   311
  jEdit is a Java/AWT/Swing application with some ambition to support
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   312
  ``native'' look-and-feel on all platforms, within the limits of what Oracle
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   313
  as Java provider and major operating system distributors allow (see also
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   314
  \secref{sec:problems}).
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   315
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
   316
  Isabelle/jEdit enables platform-specific look-and-feel by default as
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   317
  follows.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   318
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   319
    \<^descr>[Linux:] The platform-independent \<^emph>\<open>Metal\<close> is used by default.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   320
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   321
    The Linux-specific \<^emph>\<open>GTK+\<close> also works under the side-condition that the
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   322
    overall GTK theme and options are selected in a way that works with Java
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   323
    AWT/Swing. The JVM has no direct influence of GTK rendering.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   324
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   325
    \<^descr>[Windows:] Regular \<^emph>\<open>Windows\<close> is used by default.
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   326
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   327
    \<^descr>[Mac OS X:] Regular \<^emph>\<open>Mac OS X\<close> is used by default.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   328
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   329
    The bundled \<^emph>\<open>MacOSX\<close> plugin provides various functions that are expected
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   330
    from applications on that particular platform: quit from menu or dock,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   331
    preferences menu, drag-and-drop of text files on the application,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   332
    full-screen mode for main editor windows. It is advisable to have the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   333
    \<^emph>\<open>MacOSX\<close> plugin enabled all the time on that platform.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   334
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   335
  Users may experiment with different Swing look-and-feels, but need to keep
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   336
  in mind that this extra variance of GUI functionality is unlikely to work in
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   337
  arbitrary combinations. The platform-independent \<^emph>\<open>Metal\<close> and \<^emph>\<open>Nimbus\<close>
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   338
  should always work on all platforms, although they are technically and
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   339
  stylistically outdated. The historic \<^emph>\<open>CDE/Motif\<close> on Linux should be
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   340
  ignored.
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   341
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   342
  After changing the look-and-feel in \<^emph>\<open>Global Options~/ Appearance\<close>,
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   343
  Isabelle/jEdit should be restarted to take full effect.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   344
\<close>
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   345
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   346
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   347
subsection \<open>Displays with very high resolution \label{sec:hdpi}\<close>
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   348
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   349
text \<open>
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   350
  In distant past, displays with $1024 \times 768$ or $1280 \times 1024$
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   351
  pixels were considered ``high resolution'' and bitmap fonts with 12 or 14
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   352
  pixels as adequate for text rendering. In 2016, we routinely see much higher
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   353
  resolutions, e.g. ``Full HD'' at $1920 \times 1080$ pixels or ``Ultra HD'' /
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   354
  ``4K'' at $3840 \times 2160$.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   355
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   356
  GUI frameworks are usually lagging behind, with hard-wired icon sizes and
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   357
  tiny fonts. Java and jEdit do provide reasonable support for very high
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   358
  resolution, but this requires manual adjustments as described below.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   359
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   360
  \<^medskip>
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   361
  The \<^bold>\<open>operating-system\<close> usually provides some configuration for global
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   362
  scaling of text fonts, e.g.\ $120\%$--$250\%$ on Windows. This impacts
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   363
  regular GUI elements, when used with native look-and-feel: Linux \<^emph>\<open>GTK+\<close>,
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   364
  \<^emph>\<open>Windows\<close>, \<^emph>\<open>Mac OS X\<close>, respectively. Alternatively, it is possible to use
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   365
  the platform-independent \<^emph>\<open>Metal\<close> look-and-feel and readjust its main font
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   366
  sizes via jEdit options explained below. The Isabelle/jEdit \<^bold>\<open>application\<close>
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   367
  provides further options to adjust font sizes in particular GUI elements.
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   368
  Here is a summary of all relevant font properties:
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   369
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   370
    \<^item> \<^emph>\<open>Global Options / Text Area / Text font\<close>: the main text area font,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   371
    which is also used as reference point for various derived font sizes,
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   372
    e.g.\ the Output (\secref{sec:output}) and State
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   373
    (\secref{sec:state-output}) panels.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   374
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   375
    \<^item> \<^emph>\<open>Global Options / Gutter / Gutter font\<close>: the font for the gutter area
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   376
    left of the main text area, e.g.\ relevant for display of line numbers
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   377
    (disabled by default).
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   378
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   379
    \<^item> \<^emph>\<open>Global Options / Appearance / Button, menu and label font\<close> as well as
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   380
    \<^emph>\<open>List and text field font\<close>: this specifies the primary and secondary font
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   381
    for the \<^emph>\<open>Metal\<close> look-and-feel (\secref{sec:look-and-feel}).
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   382
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   383
    \<^item> \<^emph>\<open>Plugin Options / Isabelle / General / Reset Font Size\<close>: the main text
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   384
    area font size for action @{action_ref "isabelle.reset-font-size"}, e.g.\
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   385
    relevant for quick scaling like in common web browsers.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   386
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   387
    \<^item> \<^emph>\<open>Plugin Options / Console / General / Font\<close>: the console window font,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   388
    e.g.\ relevant for Isabelle/Scala command-line.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   389
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   390
  In \figref{fig:isabelle-jedit-hdpi} the \<^emph>\<open>Metal\<close> look-and-feel is configured
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   391
  with custom fonts at 30 pixels, and the main text area and console at 36
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   392
  pixels. This leads to decent rendering quality, despite the old-fashioned
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   393
  appearance of \<^emph>\<open>Metal\<close>.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   394
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   395
  \begin{figure}[!htb]
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   396
  \begin{center}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   397
  \includegraphics[width=\textwidth]{isabelle-jedit-hdpi}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   398
  \end{center}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   399
  \caption{Metal look-and-feel with custom fonts for very high resolution}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   400
  \label{fig:isabelle-jedit-hdpi}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   401
  \end{figure}
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
   402
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   403
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   404
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   405
chapter \<open>Augmented jEdit functionality\<close>
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   406
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   407
section \<open>Dockable windows \label{sec:dockables}\<close>
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   408
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   409
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   410
  In jEdit terminology, a \<^emph>\<open>view\<close> is an editor window with one or more \<^emph>\<open>text
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   411
  areas\<close> that show the content of one or more \<^emph>\<open>buffers\<close>. A regular view may
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   412
  be surrounded by \<^emph>\<open>dockable windows\<close> that show additional information in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   413
  arbitrary format, not just text; a \<^emph>\<open>plain view\<close> does not allow dockables.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   414
  The \<^emph>\<open>dockable window manager\<close> of jEdit organizes these dockable windows,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   415
  either as \<^emph>\<open>floating\<close> windows, or \<^emph>\<open>docked\<close> panels within one of the four
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   416
  margins of the view. There may be any number of floating instances of some
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   417
  dockable window, but at most one docked instance; jEdit actions that address
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   418
  \<^emph>\<open>the\<close> dockable window of a particular kind refer to the unique docked
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   419
  instance.
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   420
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   421
  Dockables are used routinely in jEdit for important functionality like
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   422
  \<^emph>\<open>HyperSearch Results\<close> or the \<^emph>\<open>File System Browser\<close>. Plugins often provide
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   423
  a central dockable to access their key functionality, which may be opened by
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   424
  the user on demand. The Isabelle/jEdit plugin takes this approach to the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   425
  extreme: its plugin menu provides the entry-points to many panels that are
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   426
  managed as dockable windows. Some important panels are docked by default,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   427
  e.g.\ \<^emph>\<open>Documentation\<close>, \<^emph>\<open>Output\<close>, \<^emph>\<open>Query\<close>, but the user can change this
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   428
  arrangement easily and persistently.
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   429
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   430
  Compared to plain jEdit, dockable window management in Isabelle/jEdit is
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   431
  slightly augmented according to the the following principles:
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   432
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   433
  \<^item> Floating windows are dependent on the main window as \<^emph>\<open>dialog\<close> in
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   434
  the sense of Java/AWT/Swing. Dialog windows always stay on top of the view,
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   435
  which is particularly important in full-screen mode. The desktop environment
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   436
  of the underlying platform may impose further policies on such dependent
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   437
  dialogs, in contrast to fully independent windows, e.g.\ some window
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   438
  management functions may be missing.
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   439
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   440
  \<^item> Keyboard focus of the main view vs.\ a dockable window is carefully
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   441
  managed according to the intended semantics, as a panel mainly for output or
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   442
  input. For example, activating the \<^emph>\<open>Output\<close> (\secref{sec:output}) panel
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   443
  via the dockable window manager returns keyboard focus to the main text
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   444
  area, but for \<^emph>\<open>Query\<close> (\secref{sec:query}) the focus is given to the
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   445
  main input field of that panel.
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   446
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   447
  \<^item> Panels that provide their own text area for output have an additional
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   448
  dockable menu item \<^emph>\<open>Detach\<close>. This produces an independent copy of the
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   449
  current output as a floating \<^emph>\<open>Info\<close> window, which displays that content
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   450
  independently of ongoing changes of the PIDE document-model. Note that
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   451
  Isabelle/jEdit popup windows (\secref{sec:tooltips-hyperlinks}) provide a
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   452
  similar \<^emph>\<open>Detach\<close> operation as an icon.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   453
\<close>
57316
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   454
134d3b6c135e more on dockable windows;
wenzelm
parents: 57315
diff changeset
   455
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   456
section \<open>Isabelle symbols \label{sec:symbols}\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   457
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   458
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   459
  Isabelle sources consist of \<^emph>\<open>symbols\<close> that extend plain ASCII to allow
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   460
  infinitely many mathematical symbols within the formal sources. This works
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   461
  without depending on particular encodings and varying Unicode
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   462
  standards.\<^footnote>\<open>Raw Unicode characters within formal sources would compromise
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   463
  portability and reliability in the face of changing interpretation of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   464
  special features of Unicode, such as Combining Characters or Bi-directional
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   465
  Text.\<close> See also @{cite "Wenzel:2011:CICM"}.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   466
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   467
  For the prover back-end, formal text consists of ASCII characters that are
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   468
  grouped according to some simple rules, e.g.\ as plain ``\<^verbatim>\<open>a\<close>'' or symbolic
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   469
  ``\<^verbatim>\<open>\<alpha>\<close>''. For the editor front-end, a certain subset of symbols is rendered
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   470
  physically via Unicode glyphs, in order to show ``\<^verbatim>\<open>\<alpha>\<close>'' as ``\<open>\<alpha>\<close>'', for
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   471
  example. This symbol interpretation is specified by the Isabelle system
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   472
  distribution in @{file "$ISABELLE_HOME/etc/symbols"} and may be augmented by
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   473
  the user in @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"}.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   474
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   475
  The appendix of @{cite "isabelle-isar-ref"} gives an overview of the
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   476
  standard interpretation of finitely many symbols from the infinite
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   477
  collection. Uninterpreted symbols are displayed literally, e.g.\
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   478
  ``\<^verbatim>\<open>\<foobar>\<close>''. Overlap of Unicode characters used in symbol
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   479
  interpretation with informal ones (which might appear e.g.\ in comments)
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   480
  needs to be avoided. Raw Unicode characters within prover source files
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   481
  should be restricted to informal parts, e.g.\ to write text in non-latin
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   482
  alphabets in comments.
61506
wenzelm
parents: 61504
diff changeset
   483
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   484
61506
wenzelm
parents: 61504
diff changeset
   485
paragraph \<open>Encoding.\<close>
wenzelm
parents: 61504
diff changeset
   486
text \<open>Technically, the Unicode view on Isabelle symbols is an \<^emph>\<open>encoding\<close>
wenzelm
parents: 61504
diff changeset
   487
  called \<^verbatim>\<open>UTF-8-Isabelle\<close> in jEdit (not in the underlying JVM). It is
wenzelm
parents: 61504
diff changeset
   488
  provided by the Isabelle/jEdit plugin and enabled by default for all source
wenzelm
parents: 61504
diff changeset
   489
  files. Sometimes such defaults are reset accidentally, or malformed UTF-8
wenzelm
parents: 61504
diff changeset
   490
  sequences in the text force jEdit to fall back on a different encoding like
wenzelm
parents: 61504
diff changeset
   491
  \<^verbatim>\<open>ISO-8859-15\<close>. In that case, verbatim ``\<^verbatim>\<open>\<alpha>\<close>'' will be shown in the text
wenzelm
parents: 61504
diff changeset
   492
  buffer instead of its Unicode rendering ``\<open>\<alpha>\<close>''. The jEdit menu operation
wenzelm
parents: 61504
diff changeset
   493
  \<^emph>\<open>File~/ Reload with Encoding~/ UTF-8-Isabelle\<close> helps to resolve such
wenzelm
parents: 61504
diff changeset
   494
  problems (after repairing malformed parts of the text).
wenzelm
parents: 61504
diff changeset
   495
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   496
61506
wenzelm
parents: 61504
diff changeset
   497
paragraph \<open>Font.\<close>
wenzelm
parents: 61504
diff changeset
   498
text \<open>Correct rendering via Unicode requires a font that contains glyphs for
wenzelm
parents: 61504
diff changeset
   499
  the corresponding codepoints. Most system fonts lack that, so Isabelle/jEdit
wenzelm
parents: 61504
diff changeset
   500
  prefers its own application font \<^verbatim>\<open>IsabelleText\<close>, which ensures that
wenzelm
parents: 61504
diff changeset
   501
  standard collection of Isabelle symbols are actually seen on the screen (or
wenzelm
parents: 61504
diff changeset
   502
  printer).
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   503
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   504
  Note that a Java/AWT/Swing application can load additional fonts only if
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   505
  they are not installed on the operating system already! Some outdated
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   506
  version of \<^verbatim>\<open>IsabelleText\<close> that happens to be provided by the operating
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   507
  system would prevent Isabelle/jEdit to use its bundled version. This could
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   508
  lead to missing glyphs (black rectangles), when the system version of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   509
  \<^verbatim>\<open>IsabelleText\<close> is older than the application version. This problem can be
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   510
  avoided by refraining to ``install'' any version of \<^verbatim>\<open>IsabelleText\<close> in the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   511
  first place, although it is occasionally tempting to use the same font in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   512
  other applications.
61506
wenzelm
parents: 61504
diff changeset
   513
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   514
61506
wenzelm
parents: 61504
diff changeset
   515
paragraph \<open>Input methods.\<close>
wenzelm
parents: 61504
diff changeset
   516
text \<open>In principle, Isabelle/jEdit could delegate the problem to produce
wenzelm
parents: 61504
diff changeset
   517
  Isabelle symbols in their Unicode rendering to the underlying operating
wenzelm
parents: 61504
diff changeset
   518
  system and its \<^emph>\<open>input methods\<close>. Regular jEdit also provides various ways to
wenzelm
parents: 61504
diff changeset
   519
  work with \<^emph>\<open>abbreviations\<close> to produce certain non-ASCII characters. Since
wenzelm
parents: 61504
diff changeset
   520
  none of these standard input methods work satisfactorily for the
wenzelm
parents: 61504
diff changeset
   521
  mathematical characters required for Isabelle, various specific
wenzelm
parents: 61504
diff changeset
   522
  Isabelle/jEdit mechanisms are provided.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   523
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   524
  This is a summary for practically relevant input methods for Isabelle
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   525
  symbols.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   526
61504
wenzelm
parents: 61503
diff changeset
   527
  \<^enum> The \<^emph>\<open>Symbols\<close> panel: some GUI buttons allow to insert certain symbols in
wenzelm
parents: 61503
diff changeset
   528
  the text buffer. There are also tooltips to reveal the official Isabelle
wenzelm
parents: 61503
diff changeset
   529
  representation with some additional information about \<^emph>\<open>symbol
wenzelm
parents: 61503
diff changeset
   530
  abbreviations\<close> (see below).
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   531
61504
wenzelm
parents: 61503
diff changeset
   532
  \<^enum> Copy/paste from decoded source files: text that is rendered as Unicode
wenzelm
parents: 61503
diff changeset
   533
  already can be re-used to produce further text. This also works between
wenzelm
parents: 61503
diff changeset
   534
  different applications, e.g.\ Isabelle/jEdit and some web browser or mail
wenzelm
parents: 61503
diff changeset
   535
  client, as long as the same Unicode view on Isabelle symbols is used.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   536
61504
wenzelm
parents: 61503
diff changeset
   537
  \<^enum> Copy/paste from prover output within Isabelle/jEdit. The same principles
wenzelm
parents: 61503
diff changeset
   538
  as for text buffers apply, but note that \<^emph>\<open>copy\<close> in secondary Isabelle/jEdit
wenzelm
parents: 61503
diff changeset
   539
  windows works via the keyboard shortcuts \<^verbatim>\<open>C+c\<close> or \<^verbatim>\<open>C+INSERT\<close>, while jEdit
wenzelm
parents: 61503
diff changeset
   540
  menu actions always refer to the primary text area!
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   541
61504
wenzelm
parents: 61503
diff changeset
   542
  \<^enum> Completion provided by Isabelle plugin (see \secref{sec:completion}).
wenzelm
parents: 61503
diff changeset
   543
  Isabelle symbols have a canonical name and optional abbreviations. This can
wenzelm
parents: 61503
diff changeset
   544
  be used with the text completion mechanism of Isabelle/jEdit, to replace a
wenzelm
parents: 61503
diff changeset
   545
  prefix of the actual symbol like \<^verbatim>\<open>\<lambda>\<close>, or its name preceded by backslash
wenzelm
parents: 61503
diff changeset
   546
  \<^verbatim>\<open>\lambda\<close>, or its ASCII abbreviation \<^verbatim>\<open>%\<close> by the Unicode rendering.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   547
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   548
  The following table is an extract of the information provided by the
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   549
  standard @{file "$ISABELLE_HOME/etc/symbols"} file:
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   550
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   551
  \<^medskip>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   552
  \begin{tabular}{lll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   553
    \<^bold>\<open>symbol\<close> & \<^bold>\<open>name with backslash\<close> & \<^bold>\<open>abbreviation\<close> \\\hline
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   554
    \<open>\<lambda>\<close> & \<^verbatim>\<open>\lambda\<close> & \<^verbatim>\<open>%\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   555
    \<open>\<Rightarrow>\<close> & \<^verbatim>\<open>\Rightarrow\<close> & \<^verbatim>\<open>=>\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   556
    \<open>\<Longrightarrow>\<close> & \<^verbatim>\<open>\Longrightarrow\<close> & \<^verbatim>\<open>==>\<close> \\[0.5ex]
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   557
    \<open>\<And>\<close> & \<^verbatim>\<open>\And\<close> & \<^verbatim>\<open>!!\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   558
    \<open>\<equiv>\<close> & \<^verbatim>\<open>\equiv\<close> & \<^verbatim>\<open>==\<close> \\[0.5ex]
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   559
    \<open>\<forall>\<close> & \<^verbatim>\<open>\forall\<close> & \<^verbatim>\<open>!\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   560
    \<open>\<exists>\<close> & \<^verbatim>\<open>\exists\<close> & \<^verbatim>\<open>?\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   561
    \<open>\<longrightarrow>\<close> & \<^verbatim>\<open>\longrightarrow\<close> & \<^verbatim>\<open>-->\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   562
    \<open>\<and>\<close> & \<^verbatim>\<open>\and\<close> & \<^verbatim>\<open>&\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   563
    \<open>\<or>\<close> & \<^verbatim>\<open>\or\<close> & \<^verbatim>\<open>|\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   564
    \<open>\<not>\<close> & \<^verbatim>\<open>\not\<close> & \<^verbatim>\<open>~\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   565
    \<open>\<noteq>\<close> & \<^verbatim>\<open>\noteq\<close> & \<^verbatim>\<open>~=\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   566
    \<open>\<in>\<close> & \<^verbatim>\<open>\in\<close> & \<^verbatim>\<open>:\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   567
    \<open>\<notin>\<close> & \<^verbatim>\<open>\notin\<close> & \<^verbatim>\<open>~:\<close> \\
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   568
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   569
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   570
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   571
  Note that the above abbreviations refer to the input method. The logical
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   572
  notation provides ASCII alternatives that often coincide, but sometimes
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   573
  deviate. This occasionally causes user confusion with very old-fashioned
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   574
  Isabelle source that use ASCII replacement notation like \<^verbatim>\<open>!\<close> or \<^verbatim>\<open>ALL\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   575
  directly in the text.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   576
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   577
  On the other hand, coincidence of symbol abbreviations with ASCII
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   578
  replacement syntax syntax helps to update old theory sources via explicit
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   579
  completion (see also \<^verbatim>\<open>C+b\<close> explained in \secref{sec:completion}).
61506
wenzelm
parents: 61504
diff changeset
   580
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   581
61506
wenzelm
parents: 61504
diff changeset
   582
paragraph \<open>Control symbols.\<close>
wenzelm
parents: 61504
diff changeset
   583
text \<open>There are some special control symbols to modify the display style of a
wenzelm
parents: 61504
diff changeset
   584
  single symbol (without nesting). Control symbols may be applied to a region
wenzelm
parents: 61504
diff changeset
   585
  of selected text, either using the \<^emph>\<open>Symbols\<close> panel or keyboard shortcuts or
wenzelm
parents: 61504
diff changeset
   586
  jEdit actions. These editor operations produce a separate control symbol for
wenzelm
parents: 61504
diff changeset
   587
  each symbol in the text, in order to make the whole text appear in a certain
wenzelm
parents: 61504
diff changeset
   588
  style.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   589
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   590
  \<^medskip>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   591
  \begin{tabular}{llll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   592
    \<^bold>\<open>style\<close> & \<^bold>\<open>symbol\<close> & \<^bold>\<open>shortcut\<close> & \<^bold>\<open>action\<close> \\\hline
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   593
    superscript & \<^verbatim>\<open>\<^sup>\<close> & \<^verbatim>\<open>C+e UP\<close> & @{action_ref "isabelle.control-sup"} \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   594
    subscript & \<^verbatim>\<open>\<^sub>\<close> & \<^verbatim>\<open>C+e DOWN\<close> & @{action_ref "isabelle.control-sub"} \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   595
    bold face & \<^verbatim>\<open>\<^bold>\<close> & \<^verbatim>\<open>C+e RIGHT\<close> & @{action_ref "isabelle.control-bold"} \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   596
    emphasized & \<^verbatim>\<open>\<^emph>\<close> & \<^verbatim>\<open>C+e LEFT\<close> & @{action_ref "isabelle.control-emph"} \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   597
    reset & & \<^verbatim>\<open>C+e BACK_SPACE\<close> & @{action_ref "isabelle.control-reset"} \\
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   598
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   599
  \<^medskip>
61483
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   600
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   601
  To produce a single control symbol, it is also possible to complete on
61504
wenzelm
parents: 61503
diff changeset
   602
  \<^verbatim>\<open>\sup\<close>, \<^verbatim>\<open>\sub\<close>, \<^verbatim>\<open>\bold\<close>, \<^verbatim>\<open>\emph\<close> as for regular symbols.
61483
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   603
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   604
  The emphasized style only takes effect in document output, not in the
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   605
  editor.
07c8d5d8acab added action "isabelle-emph";
wenzelm
parents: 61477
diff changeset
   606
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   607
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   608
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   609
section \<open>SideKick parsers \label{sec:sidekick}\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   610
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   611
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   612
  The \<^emph>\<open>SideKick\<close> plugin provides some general services to display buffer
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   613
  structure in a tree view.
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   614
57336
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   615
  Isabelle/jEdit provides SideKick parsers for its main mode for theory files,
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   616
  as well as some minor modes for the \<^verbatim>\<open>NEWS\<close> file (see
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   617
  \figref{fig:sidekick}), session \<^verbatim>\<open>ROOT\<close> files, and system \<^verbatim>\<open>options\<close>.
57336
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   618
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   619
  \begin{figure}[!htb]
57336
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   620
  \begin{center}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   621
  \includegraphics[scale=0.333]{sidekick}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   622
  \end{center}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   623
  \caption{The Isabelle NEWS file with SideKick tree view}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   624
  \label{fig:sidekick}
e13c5dd9c7de added screenshot;
wenzelm
parents: 57335
diff changeset
   625
  \end{figure}
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   626
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   627
  Moreover, the special SideKick parser \<^verbatim>\<open>isabelle-markup\<close> provides access to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   628
  the full (uninterpreted) markup tree of the PIDE document model of the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   629
  current buffer. This is occasionally useful for informative purposes, but
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   630
  the amount of displayed information might cause problems for large buffers,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   631
  both for the human and the machine.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   632
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   633
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   634
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   635
section \<open>Scala console \label{sec:scala-console}\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   636
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   637
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   638
  The \<^emph>\<open>Console\<close> plugin manages various shells (command interpreters), e.g.\
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   639
  \<^emph>\<open>BeanShell\<close>, which is the official jEdit scripting language, and the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   640
  cross-platform \<^emph>\<open>System\<close> shell. Thus the console provides similar
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   641
  functionality than the Emacs buffers \<^verbatim>\<open>*scratch*\<close> and \<^verbatim>\<open>*shell*\<close>.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   642
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   643
  Isabelle/jEdit extends the repertoire of the console by \<^emph>\<open>Scala\<close>, which is
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   644
  the regular Scala toplevel loop running inside the same JVM process as
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   645
  Isabelle/jEdit itself. This means the Scala command interpreter has access
57603
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   646
  to the JVM name space and state of the running Prover IDE application. The
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   647
  default environment imports the full content of packages \<^verbatim>\<open>isabelle\<close> and
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   648
  \<^verbatim>\<open>isabelle.jedit\<close>.
57603
0f58af858813 more default imports;
wenzelm
parents: 57589
diff changeset
   649
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   650
  For example, \<^verbatim>\<open>PIDE\<close> refers to the Isabelle/jEdit plugin object, and \<^verbatim>\<open>view\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   651
  to the current editor view of jEdit. The Scala expression
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   652
  \<^verbatim>\<open>PIDE.snapshot(view)\<close> makes a PIDE document snapshot of the current buffer
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   653
  within the current editor view.
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   654
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   655
  This helps to explore Isabelle/Scala functionality interactively. Some care
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   656
  is required to avoid interference with the internals of the running
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   657
  application, especially in production use.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   658
\<close>
57319
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   659
3ca8216f4a96 clarified section structure;
wenzelm
parents: 57318
diff changeset
   660
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   661
section \<open>File-system access\<close>
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   662
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   663
text \<open>
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   664
  File specifications in jEdit follow various formats and conventions
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   665
  according to \<^emph>\<open>Virtual File Systems\<close>, which may be also provided by
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   666
  additional plugins. This allows to access remote files via the \<^verbatim>\<open>http:\<close>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   667
  protocol prefix, for example. Isabelle/jEdit attempts to work with the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   668
  file-system model of jEdit as far as possible. In particular, theory sources
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   669
  are passed directly from the editor to the prover, without indirection via
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   670
  physical files.
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   671
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   672
  Despite the flexibility of URLs in jEdit, local files are particularly
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   673
  important and are accessible without protocol prefix. Here the path notation
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   674
  is that of the Java Virtual Machine on the underlying platform. On Windows
60257
wenzelm
parents: 60256
diff changeset
   675
  the preferred form uses backslashes, but happens to accept also forward
wenzelm
parents: 60256
diff changeset
   676
  slashes like Unix/POSIX. Further differences arise due to Windows drive
wenzelm
parents: 60256
diff changeset
   677
  letters and network shares.
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   678
57331
wenzelm
parents: 57329
diff changeset
   679
  The Java notation for files needs to be distinguished from the one of
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   680
  Isabelle, which uses POSIX notation with forward slashes on \<^emph>\<open>all\<close>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   681
  platforms.\<^footnote>\<open>Isabelle/ML on Windows uses Cygwin file-system access and
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   682
  Unix-style path notation.\<close> Moreover, environment variables from the Isabelle
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   683
  process may be used freely, e.g.\ @{file "$ISABELLE_HOME/etc/symbols"} or
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   684
  @{file_unchecked "$POLYML_HOME/README"}. There are special shortcuts: @{file
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   685
  "~"} for @{file "$USER_HOME"} and @{file "~~"} for @{file "$ISABELLE_HOME"}.
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   686
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   687
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   688
  Since jEdit happens to support environment variables within file
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   689
  specifications as well, it is natural to use similar notation within the
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   690
  editor, e.g.\ in the file-browser. This does not work in full generality,
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   691
  though, due to the bias of jEdit towards platform-specific notation and of
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   692
  Isabelle towards POSIX. Moreover, the Isabelle settings environment is not
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   693
  yet active when starting Isabelle/jEdit via its standard application
60257
wenzelm
parents: 60256
diff changeset
   694
  wrapper, in contrast to @{tool jedit} run from the command line
wenzelm
parents: 60256
diff changeset
   695
  (\secref{sec:command-line}).
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   696
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   697
  Isabelle/jEdit imitates \<^verbatim>\<open>$ISABELLE_HOME\<close> and \<^verbatim>\<open>$ISABELLE_HOME_USER\<close> within
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   698
  the Java process environment, in order to allow easy access to these
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   699
  important places from the editor. The file browser of jEdit also includes
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   700
  \<^emph>\<open>Favorites\<close> for these two important locations.
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   701
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   702
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   703
  Path specifications in prover input or output usually include formal markup
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   704
  that turns it into a hyperlink (see also \secref{sec:tooltips-hyperlinks}).
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   705
  This allows to open the corresponding file in the text editor, independently
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   706
  of the path notation.
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   707
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   708
  Formally checked paths in prover input are subject to completion
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   709
  (\secref{sec:completion}): partial specifications are resolved via directory
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   710
  content and possible completions are offered in a popup.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   711
\<close>
57318
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   712
2b89a3a34cc3 clarified section structure;
wenzelm
parents: 57317
diff changeset
   713
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   714
chapter \<open>Prover IDE functionality \label{sec:document-model}\<close>
57315
d0f34f328ffa clarified section structure;
wenzelm
parents: 57314
diff changeset
   715
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   716
section \<open>Document model \label{sec:document-model}\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   717
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   718
text \<open>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   719
  The document model is central to the PIDE architecture: the editor and the
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   720
  prover have a common notion of structured source text with markup, which is
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   721
  produced by formal processing. The editor is responsible for edits of
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   722
  document source, as produced by the user. The prover is responsible for
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   723
  reports of document markup, as produced by its processing in the background.
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   724
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   725
  Isabelle/jEdit handles classic editor events of jEdit, in order to connect
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   726
  the physical world of the GUI (with its singleton state) to the mathematical
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   727
  world of multiple document versions (with timeless and stateless updates).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   728
\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   729
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   730
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   731
subsection \<open>Editor buffers and document nodes \label{sec:buffer-node}\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   732
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   733
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   734
  As a regular text editor, jEdit maintains a collection of \<^emph>\<open>buffers\<close> to
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   735
  store text files; each buffer may be associated with any number of visible
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   736
  \<^emph>\<open>text areas\<close>. Buffers are subject to an \<^emph>\<open>edit mode\<close> that is determined
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   737
  from the file name extension. The following modes are treated specifically
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   738
  in Isabelle/jEdit:
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   739
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   740
  \<^medskip>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   741
  \begin{tabular}{lll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   742
  \<^bold>\<open>mode\<close> & \<^bold>\<open>file extension\<close> & \<^bold>\<open>content\<close> \\\hline
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   743
  \<^verbatim>\<open>isabelle\<close> & \<^verbatim>\<open>.thy\<close> & theory source \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   744
  \<^verbatim>\<open>isabelle-ml\<close> & \<^verbatim>\<open>.ML\<close> & Isabelle/ML source \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
   745
  \<^verbatim>\<open>sml\<close> & \<^verbatim>\<open>.sml\<close> or \<^verbatim>\<open>.sig\<close> & Standard ML source \\
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   746
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   747
  \<^medskip>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   748
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   749
  All jEdit buffers are automatically added to the PIDE document-model as
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   750
  \<^emph>\<open>document nodes\<close>. The overall document structure is defined by the theory
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   751
  nodes in two dimensions:
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   752
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   753
    \<^enum> via \<^bold>\<open>theory imports\<close> that are specified in the \<^emph>\<open>theory header\<close> using
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   754
    concrete syntax of the @{command_ref theory} command @{cite
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   755
    "isabelle-isar-ref"};
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   756
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   757
    \<^enum> via \<^bold>\<open>auxiliary files\<close> that are loaded into a theory by special \<^emph>\<open>load
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   758
    commands\<close>, notably @{command_ref ML_file} and @{command_ref SML_file}
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   759
    @{cite "isabelle-isar-ref"}.
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   760
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   761
  In any case, source files are managed by the PIDE infrastructure: the
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   762
  physical file-system only plays a subordinate role. The relevant version of
60257
wenzelm
parents: 60256
diff changeset
   763
  source text is passed directly from the editor to the prover, using internal
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   764
  communication channels.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   765
\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   766
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   767
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   768
subsection \<open>Theories \label{sec:theories}\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   769
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   770
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   771
  The \<^emph>\<open>Theories\<close> panel (see also \figref{fig:theories}) provides an overview
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   772
  of the status of continuous checking of theory nodes within the document
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   773
  model. Unlike batch sessions of @{tool build} @{cite "isabelle-system"},
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   774
  theory nodes are identified by full path names; this allows to work with
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   775
  multiple (disjoint) Isabelle sessions simultaneously within the same editor
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   776
  session.
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   777
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   778
  \begin{figure}[!htb]
57339
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   779
  \begin{center}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   780
  \includegraphics[scale=0.333]{theories}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   781
  \end{center}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   782
  \caption{Theories panel with an overview of the document-model, and some
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   783
  jEdit text areas as editable view on some of the document nodes}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   784
  \label{fig:theories}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   785
  \end{figure}
3bb94256e0ed added screenshot;
wenzelm
parents: 57338
diff changeset
   786
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   787
  Certain events to open or update editor buffers cause Isabelle/jEdit to
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   788
  resolve dependencies of theory imports. The system requests to load
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   789
  additional files into editor buffers, in order to be included in the
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   790
  document model for further checking. It is also possible to let the system
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   791
  resolve dependencies automatically, according to the system option
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   792
  @{system_option jedit_auto_load}.
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
   793
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   794
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   795
  The visible \<^emph>\<open>perspective\<close> of Isabelle/jEdit is defined by the collective
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   796
  view on theory buffers via open text areas. The perspective is taken as a
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   797
  hint for document processing: the prover ensures that those parts of a
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   798
  theory where the user is looking are checked, while other parts that are
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   799
  presently not required are ignored. The perspective is changed by opening or
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   800
  closing text area windows, or scrolling within a window.
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   801
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   802
  The \<^emph>\<open>Theories\<close> panel provides some further options to influence the process
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   803
  of continuous checking: it may be switched off globally to restrict the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   804
  prover to superficial processing of command syntax. It is also possible to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   805
  indicate theory nodes as \<^emph>\<open>required\<close> for continuous checking: this means
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   806
  such nodes and all their imports are always processed independently of the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   807
  visibility status (if continuous checking is enabled). Big theory libraries
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   808
  that are marked as required can have significant impact on performance,
54330
wenzelm
parents: 54329
diff changeset
   809
  though.
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   810
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   811
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   812
  Formal markup of checked theory content is turned into GUI rendering, based
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   813
  on a standard repertoire known from IDEs for programming languages: colors,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   814
  icons, highlighting, squiggly underlines, tooltips, hyperlinks etc. For
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   815
  outer syntax of Isabelle/Isar there is some traditional syntax-highlighting
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   816
  via static keywords and tokenization within the editor; this buffer syntax
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   817
  is determined from theory imports. In contrast, the painting of inner syntax
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   818
  (term language etc.)\ uses semantic information that is reported dynamically
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   819
  from the logical context. Thus the prover can provide additional markup to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   820
  help the user to understand the meaning of formal text, and to produce more
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   821
  text with some add-on tools (e.g.\ information messages with \<^emph>\<open>sendback\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   822
  markup by automated provers or disprovers in the background).
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   823
\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   824
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   825
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   826
subsection \<open>Auxiliary files \label{sec:aux-files}\<close>
57322
88d7e3eca84b more on "Document model";
wenzelm
parents: 57321
diff changeset
   827
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   828
text \<open>
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   829
  Special load commands like @{command_ref ML_file} and @{command_ref
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
   830
  SML_file} @{cite "isabelle-isar-ref"} refer to auxiliary files within some
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   831
  theory. Conceptually, the file argument of the command extends the theory
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   832
  source by the content of the file, but its editor buffer may be loaded~/
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   833
  changed~/ saved separately. The PIDE document model propagates changes of
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   834
  auxiliary file content to the corresponding load command in the theory, to
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   835
  update and process it accordingly: changes of auxiliary file content are
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
   836
  treated as changes of the corresponding load command.
57323
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   837
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   838
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   839
  As a concession to the massive amount of ML files in Isabelle/HOL itself,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   840
  the content of auxiliary files is only added to the PIDE document-model on
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   841
  demand, the first time when opened explicitly in the editor. There are
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   842
  further tricks to manage markup of ML files, such that Isabelle/HOL may be
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   843
  edited conveniently in the Prover IDE on small machines with only 8\,GB of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   844
  main memory. Using \<^verbatim>\<open>Pure\<close> as logic session image, the exploration may start
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   845
  at the top @{file "$ISABELLE_HOME/src/HOL/Main.thy"} or the bottom @{file
57323
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   846
  "$ISABELLE_HOME/src/HOL/HOL.thy"}, for example.
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   847
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   848
  Initially, before an auxiliary file is opened in the editor, the prover
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   849
  reads its content from the physical file-system. After the file is opened
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   850
  for the first time in the editor, e.g.\ by following the hyperlink
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   851
  (\secref{sec:tooltips-hyperlinks}) for the argument of its @{command
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   852
  ML_file} command, the content is taken from the jEdit buffer.
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   853
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   854
  The change of responsibility from prover to editor counts as an update of
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   855
  the document content, so subsequent theory sources need to be re-checked.
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   856
  When the buffer is closed, the responsibility remains to the editor: the
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   857
  file may be opened again without causing another document update.
57323
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   858
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   859
  A file that is opened in the editor, but its theory with the load command is
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   860
  not, is presently inactive in the document model. A file that is loaded via
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   861
  multiple load commands is associated to an arbitrary one: this situation is
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   862
  morally unsupported and might lead to confusion.
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   863
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   864
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   865
  Output that refers to an auxiliary file is combined with that of the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   866
  corresponding load command, and shown whenever the file or the command are
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   867
  active (see also \secref{sec:output}).
57323
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   868
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   869
  Warnings, errors, and other useful markup is attached directly to the
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   870
  positions in the auxiliary file buffer, in the manner of other well-known
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   871
  IDEs. By using the load command @{command SML_file} as explained in @{file
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   872
  "$ISABELLE_HOME/src/Tools/SML/Examples.thy"}, Isabelle/jEdit may be used as
3c66ca9b425b more on "Auxiliary files";
wenzelm
parents: 57322
diff changeset
   873
  fully-featured IDE for Standard ML, independently of theory or proof
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   874
  development: the required theory merely serves as some kind of project file
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   875
  for a collection of SML source modules.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   876
\<close>
54322
9d156ded3c2a more documentation;
wenzelm
parents: 54321
diff changeset
   877
54352
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
   878
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   879
section \<open>Output \label{sec:output}\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   880
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   881
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   882
  Prover output consists of \<^emph>\<open>markup\<close> and \<^emph>\<open>messages\<close>. Both are directly
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   883
  attached to the corresponding positions in the original source text, and
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   884
  visualized in the text area, e.g.\ as text colours for free and bound
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   885
  variables, or as squiggly underlines for warnings, errors etc.\ (see also
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   886
  \figref{fig:output}). In the latter case, the corresponding messages are
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   887
  shown by hovering with the mouse over the highlighted text --- although in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   888
  many situations the user should already get some clue by looking at the
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   889
  position of the text highlighting, without the text itself.
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   890
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   891
  \begin{figure}[!htb]
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   892
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
   893
  \includegraphics[scale=0.333]{output}
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   894
  \end{center}
54372
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   895
  \caption{Multiple views on prover output: gutter area with icon,
2d61935eed4a misc tuning;
wenzelm
parents: 54362
diff changeset
   896
    text area with popup, overview area, Theories panel, Output panel}
54357
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   897
  \label{fig:output}
157b6eee6a76 more screenshots;
wenzelm
parents: 54356
diff changeset
   898
  \end{figure}
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   899
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   900
  The ``gutter area'' on the left-hand-side of the text area uses icons to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   901
  provide a summary of the messages within the adjacent line of text. Message
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   902
  priorities are used to prefer errors over warnings, warnings over
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   903
  information messages, but plain output is ignored.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   904
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   905
  The ``overview area'' on the right-hand-side of the text area uses similar
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   906
  information to paint small rectangles for the overall status of the whole
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   907
  text buffer. The graphics is scaled to fit the logical buffer length into
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   908
  the given window height. Mouse clicks on the overview area position the
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   909
  cursor approximately to the corresponding line of text in the buffer.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   910
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   911
  Another course-grained overview is provided by the \<^emph>\<open>Theories\<close> panel, but
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   912
  without direct correspondence to text positions. A double-click on one of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   913
  the theory entries with their status overview opens the corresponding text
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   914
  buffer, without changing the cursor position.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   915
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   916
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   917
  In addition, the \<^emph>\<open>Output\<close> panel displays prover messages that correspond to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   918
  a given command, within a separate window.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   919
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   920
  The cursor position in the presently active text area determines the prover
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   921
  command whose cumulative message output is appended and shown in that window
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   922
  (in canonical order according to the internal execution of the command).
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   923
  There are also control elements to modify the update policy of the output
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   924
  wrt.\ continued editor movements. This is particularly useful with several
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
   925
  independent instances of the \<^emph>\<open>Output\<close> panel, which the Dockable Window
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   926
  Manager of jEdit can handle conveniently.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   927
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   928
  Former users of the old TTY interaction model (e.g.\ Proof~General) might
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   929
  find a separate window for prover messages familiar, but it is important to
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
   930
  understand that the main Prover IDE feedback happens elsewhere. It is
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   931
  possible to do meaningful proof editing within the primary text area and its
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
   932
  markup, while using secondary output windows only rarely.
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   933
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   934
  The main purpose of the output window is to ``debug'' unclear situations by
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   935
  inspecting internal state of the prover.\<^footnote>\<open>In that sense, unstructured tactic
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   936
  scripts depend on continuous debugging with internal state inspection.\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   937
  Consequently, some special messages for \<^emph>\<open>tracing\<close> or \<^emph>\<open>proof state\<close> only
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   938
  appear here, and are not attached to the original source.
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   939
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   940
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   941
  In any case, prover messages also contain markup that may be explored
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   942
  recursively via tooltips or hyperlinks (see
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   943
  \secref{sec:tooltips-hyperlinks}), or clicked directly to initiate certain
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   944
  actions (see \secref{sec:auto-tools} and \secref{sec:sledgehammer}).
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   945
\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   946
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
   947
62154
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   948
section \<open>Proof state output \label{sec:state-output}\<close>
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   949
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   950
text \<open>
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   951
  FIXME
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   952
  \figref{fig:output-and-state} versus \figref{fig:output-including-state}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   953
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   954
  \begin{figure}[!htb]
62154
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   955
  \begin{center}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   956
  \includegraphics[scale=0.333]{output-and-state}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   957
  \end{center}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   958
  \caption{Separate proof state display (right) and other output (bottom).}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   959
  \label{fig:output-and-state}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   960
  \end{figure}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   961
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   962
  \begin{figure}[!htb]
62154
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   963
  \begin{center}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   964
  \includegraphics[scale=0.333]{output-including-state}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   965
  \end{center}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   966
  \caption{Proof state display within the regular output panel}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   967
  \label{fig:output-including-state}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   968
  \end{figure}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   969
\<close>
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   970
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   971
section \<open>Query \label{sec:query}\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   972
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
   973
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   974
  The \<^emph>\<open>Query\<close> panel provides various GUI forms to request extra information
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   975
  from the prover. In old times the user would have issued some diagnostic
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   976
  command like @{command find_theorems} and inspected its output, but this is
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   977
  now integrated into the Prover IDE.
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   978
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   979
  A \<^emph>\<open>Query\<close> window provides some input fields and buttons for a particular
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   980
  query command, with output in a dedicated text area. There are various query
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   981
  modes: \<^emph>\<open>Find Theorems\<close>, \<^emph>\<open>Find Constants\<close>, \<^emph>\<open>Print Context\<close>, e.g.\ see
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   982
  \figref{fig:query}. As usual in jEdit, multiple \<^emph>\<open>Query\<close> windows may be
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   983
  active at the same time: any number of floating instances, but at most one
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   984
  docked instance (which is used by default).
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   985
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
   986
  \begin{figure}[!htb]
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   987
  \begin{center}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   988
  \includegraphics[scale=0.333]{query}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   989
  \end{center}
62154
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
   990
  \caption{An instance of the Query panel: find theorems}
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   991
  \label{fig:query}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
   992
  \end{figure}
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   993
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   994
  \<^medskip>
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
   995
  The following GUI elements are common to all query modes:
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   996
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   997
    \<^item> The spinning wheel provides feedback about the status of a pending query
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
   998
    wrt.\ the evaluation of its context and its own operation.
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
   999
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1000
    \<^item> The \<^emph>\<open>Apply\<close> button attaches a fresh query invocation to the current
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1001
    context of the command where the cursor is pointing in the text.
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1002
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1003
    \<^item> The \<^emph>\<open>Search\<close> field allows to highlight query output according to some
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1004
    regular expression, in the notation that is commonly used on the Java
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1005
    platform.\<^footnote>\<open>@{url
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1006
    "https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html"}\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1007
    This may serve as an additional visual filter of the result.
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1008
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1009
    \<^item> The \<^emph>\<open>Zoom\<close> box controls the font size of the output area.
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1010
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1011
  All query operations are asynchronous: there is no need to wait for the
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1012
  evaluation of the document for the query context, nor for the query
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1013
  operation itself. Query output may be detached as independent \<^emph>\<open>Info\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1014
  window, using a menu operation of the dockable window manager. The printed
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1015
  result usually provides sufficient clues about the original query, with some
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1016
  hyperlink to its context (via markup of its head line).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1017
\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1018
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1019
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1020
subsection \<open>Find theorems\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1021
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1022
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1023
  The \<^emph>\<open>Query\<close> panel in \<^emph>\<open>Find Theorems\<close> mode retrieves facts from the theory
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1024
  or proof context matching all of given criteria in the \<^emph>\<open>Find\<close> text field. A
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1025
  single criterium has the following syntax:
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1026
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1027
  @{rail \<open>
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1028
    ('-'?) ('name' ':' @{syntax nameref} | 'intro' | 'elim' | 'dest' |
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1029
      'solves' | 'simp' ':' @{syntax term} | @{syntax term})
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1030
  \<close>}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1031
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1032
  See also the Isar command @{command_ref find_theorems} in @{cite
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1033
  "isabelle-isar-ref"}.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1034
\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1035
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1036
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1037
subsection \<open>Find constants\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1038
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1039
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1040
  The \<^emph>\<open>Query\<close> panel in \<^emph>\<open>Find Constants\<close> mode prints all constants whose type
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1041
  meets all of the given criteria in the \<^emph>\<open>Find\<close> text field. A single
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1042
  criterium has the following syntax:
57313
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1043
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1044
  @{rail \<open>
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1045
    ('-'?)
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1046
      ('name' ':' @{syntax nameref} | 'strict' ':' @{syntax type} | @{syntax type})
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1047
  \<close>}
c66832858f43 more on Query panel;
wenzelm
parents: 57312
diff changeset
  1048
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1049
  See also the Isar command @{command_ref find_consts} in @{cite
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1050
  "isabelle-isar-ref"}.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1051
\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1052
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1053
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1054
subsection \<open>Print context\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1055
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1056
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1057
  The \<^emph>\<open>Query\<close> panel in \<^emph>\<open>Print Context\<close> mode prints information from the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1058
  theory or proof context, or proof state. See also the Isar commands
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1059
  @{command_ref print_context}, @{command_ref print_cases}, @{command_ref
58554
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1060
  print_term_bindings}, @{command_ref print_theorems}, @{command_ref
423202f05a43 prefer @{cite} antiquotation;
wenzelm
parents: 57869
diff changeset
  1061
  print_state} described in @{cite "isabelle-isar-ref"}.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1062
\<close>
57311
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1063
550b704d665e more on Query panel -- updated Find Theorems;
wenzelm
parents: 57310
diff changeset
  1064
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1065
section \<open>Tooltips and hyperlinks \label{sec:tooltips-hyperlinks}\<close>
54352
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1066
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1067
text \<open>
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1068
  Formally processed text (prover input or output) contains rich markup
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1069
  information that can be explored further by using the \<^verbatim>\<open>CONTROL\<close> modifier
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1070
  key on Linux and Windows, or \<^verbatim>\<open>COMMAND\<close> on Mac OS X. Hovering with the mouse
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1071
  while the modifier is pressed reveals a \<^emph>\<open>tooltip\<close> (grey box over the text
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1072
  with a yellow popup) and/or a \<^emph>\<open>hyperlink\<close> (black rectangle over the text
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1073
  with change of mouse pointer); see also \figref{fig:tooltip}.
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1074
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1075
  \begin{figure}[!htb]
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1076
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1077
  \includegraphics[scale=0.5]{popup1}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1078
  \end{center}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1079
  \caption{Tooltip and hyperlink for some formal entity}
54350
wenzelm
parents: 54349
diff changeset
  1080
  \label{fig:tooltip}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1081
  \end{figure}
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1082
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1083
  Tooltip popups use the same rendering mechanisms as the main text area, and
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1084
  further tooltips and/or hyperlinks may be exposed recursively by the same
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1085
  mechanism; see \figref{fig:nested-tooltips}.
54323
d521407f8d0f more documentation;
wenzelm
parents: 54322
diff changeset
  1086
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1087
  \begin{figure}[!htb]
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1088
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1089
  \includegraphics[scale=0.5]{popup2}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1090
  \end{center}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1091
  \caption{Nested tooltips over formal entities}
54350
wenzelm
parents: 54349
diff changeset
  1092
  \label{fig:nested-tooltips}
54331
9e944630be0c more screenshots;
wenzelm
parents: 54330
diff changeset
  1093
  \end{figure}
54350
wenzelm
parents: 54349
diff changeset
  1094
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1095
  The tooltip popup window provides some controls to \<^emph>\<open>close\<close> or \<^emph>\<open>detach\<close> the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1096
  window, turning it into a separate \<^emph>\<open>Info\<close> window managed by jEdit. The
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1097
  \<^verbatim>\<open>ESCAPE\<close> key closes \<^emph>\<open>all\<close> popups, which is particularly relevant when
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1098
  nested tooltips are stacking up.
54352
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1099
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1100
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1101
  A black rectangle in the text indicates a hyperlink that may be followed by
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1102
  a mouse click (while the \<^verbatim>\<open>CONTROL\<close> or \<^verbatim>\<open>COMMAND\<close> modifier key is still
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1103
  pressed). Such jumps to other text locations are recorded by the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1104
  \<^emph>\<open>Navigator\<close> plugin, which is bundled with Isabelle/jEdit and enabled by
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1105
  default, including navigation arrows in the main jEdit toolbar.
54352
7557f9f1d4aa misc tuning and clarification;
wenzelm
parents: 54351
diff changeset
  1106
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1107
  Also note that the link target may be a file that is itself not subject to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1108
  formal document processing of the editor session and thus prevents further
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1109
  exploration: the chain of hyperlinks may end in some source file of the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1110
  underlying logic image, or within the ML bootstrap sources of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1111
  Isabelle/Pure.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1112
\<close>
54321
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
  1113
41951f427ac7 more documentation;
wenzelm
parents: 54320
diff changeset
  1114
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1115
section \<open>Completion \label{sec:completion}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1116
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1117
text \<open>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1118
  Smart completion of partial input is the IDE functionality \<^emph>\<open>par
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1119
  excellance\<close>. Isabelle/jEdit combines several sources of information to
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1120
  achieve that. Despite its complexity, it should be possible to get some idea
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1121
  how completion works by experimentation, based on the overview of completion
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1122
  varieties in \secref{sec:completion-varieties}. The remaining subsections
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1123
  explain concepts around completion more systematically.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1124
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1125
  \<^medskip>
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1126
  \<^emph>\<open>Explicit completion\<close> is triggered by the action @{action_ref
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1127
  "isabelle.complete"}, which is bound to the keyboard shortcut \<^verbatim>\<open>C+b\<close>, and
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1128
  thus overrides the jEdit default for @{action_ref "complete-word"}.
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1129
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1130
  \<^emph>\<open>Implicit completion\<close> hooks into the regular keyboard input stream of the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1131
  editor, with some event filtering and optional delays.
54361
wenzelm
parents: 54360
diff changeset
  1132
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1133
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1134
  Completion options may be configured in \<^emph>\<open>Plugin Options~/ Isabelle~/
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1135
  General~/ Completion\<close>. These are explained in further detail below, whenever
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1136
  relevant. There is also a summary of options in
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1137
  \secref{sec:completion-options}.
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1138
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1139
  The asynchronous nature of PIDE interaction means that information from the
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1140
  prover is delayed --- at least by a full round-trip of the document update
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1141
  protocol. The default options already take this into account, with a
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1142
  sufficiently long completion delay to speculate on the availability of all
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1143
  relevant information from the editor and the prover, before completing text
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1144
  immediately or producing a popup. Although there is an inherent danger of
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1145
  non-deterministic behaviour due to such real-time parameters, the general
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1146
  completion policy aims at determined results as far as possible.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1147
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1148
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1149
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1150
subsection \<open>Varieties of completion \label{sec:completion-varieties}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1151
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1152
subsubsection \<open>Built-in templates\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1153
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1154
text \<open>
57327
20a575f99cda more on "Completion";
wenzelm
parents: 57326
diff changeset
  1155
  Isabelle is ultimately a framework of nested sub-languages of different
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1156
  kinds and purposes. The completion mechanism supports this by the following
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1157
  built-in templates:
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1158
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1159
    \<^descr> \<^verbatim>\<open>`\<close> (single ASCII back-quote) supports \<^emph>\<open>quotations\<close> via text
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1160
    cartouches. There are three selections, which are always presented in the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1161
    same order and do not depend on any context information. The default
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1162
    choice produces a template ``\<open>\<open>\<box>\<close>\<close>'', where the box indicates the cursor
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1163
    position after insertion; the other choices help to repair the block
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1164
    structure of unbalanced text cartouches.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1165
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1166
    \<^descr> \<^verbatim>\<open>@{\<close> is completed to the template ``\<open>@{\<box>}\<close>'', where the box indicates
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1167
    the cursor position after insertion. Here it is convenient to use the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1168
    wildcard ``\<^verbatim>\<open>__\<close>'' or a more specific name prefix to let semantic
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1169
    completion of name-space entries propose antiquotation names.
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1170
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1171
  With some practice, input of quoted sub-languages and antiquotations of
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1172
  embedded languages should work fluently. Note that national keyboard layouts
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1173
  might cause problems with back-quote as dead key: if possible, dead keys
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1174
  should be disabled.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1175
\<close>
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1176
57327
20a575f99cda more on "Completion";
wenzelm
parents: 57326
diff changeset
  1177
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1178
subsubsection \<open>Syntax keywords\<close>
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1179
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1180
text \<open>
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1181
  Syntax completion tables are determined statically from the keywords of the
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1182
  ``outer syntax'' of the underlying edit mode: for theory files this is the
60257
wenzelm
parents: 60256
diff changeset
  1183
  syntax of Isar commands according to the cumulative theory imports.
57327
20a575f99cda more on "Completion";
wenzelm
parents: 57326
diff changeset
  1184
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1185
  Keywords are usually plain words, which means the completion mechanism only
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1186
  inserts them directly into the text for explicit completion
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1187
  (\secref{sec:completion-input}), but produces a popup
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1188
  (\secref{sec:completion-popup}) otherwise.
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1189
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1190
  At the point where outer syntax keywords are defined, it is possible to
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1191
  specify an alternative replacement string to be inserted instead of the
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1192
  keyword itself. An empty string means to suppress the keyword altogether,
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1193
  which is occasionally useful to avoid confusion, e.g.\ the rare keyword
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
  1194
  @{command simproc_setup} vs.\ the frequent name-space entry \<open>simp\<close>.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1195
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1196
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1197
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1198
subsubsection \<open>Isabelle symbols\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1199
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1200
text \<open>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1201
  The completion tables for Isabelle symbols (\secref{sec:symbols}) are
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1202
  determined statically from @{file "$ISABELLE_HOME/etc/symbols"} and
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1203
  @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"} for each symbol
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1204
  specification as follows:
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1205
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1206
  \<^medskip>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1207
  \begin{tabular}{ll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1208
  \<^bold>\<open>completion entry\<close> & \<^bold>\<open>example\<close> \\\hline
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1209
  literal symbol & \<^verbatim>\<open>\<forall>\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1210
  symbol name with backslash & \<^verbatim>\<open>\\<close>\<^verbatim>\<open>forall\<close> \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1211
  symbol abbreviation & \<^verbatim>\<open>ALL\<close> or \<^verbatim>\<open>!\<close> \\
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1212
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1213
  \<^medskip>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1214
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1215
  When inserted into the text, the above examples all produce the same Unicode
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1216
  rendering \<open>\<forall>\<close> of the underlying symbol \<^verbatim>\<open>\<forall>\<close>.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1217
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1218
  A symbol abbreviation that is a plain word, like \<^verbatim>\<open>ALL\<close>, is treated like a
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1219
  syntax keyword. Non-word abbreviations like \<^verbatim>\<open>-->\<close> are inserted more
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1220
  aggressively, except for single-character abbreviations like \<^verbatim>\<open>!\<close> above.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1221
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1222
  \<^medskip>
61960
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1223
  Additional abbreviations may be specified in @{file
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1224
  "$ISABELLE_HOME/etc/abbrevs"} and @{file_unchecked
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1225
  "$ISABELLE_HOME_USER/etc/abbrevs"}. The file content follows general Isar
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1226
  outer syntax @{cite "isabelle-isar-ref"}. Abbreviations are specified as
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1227
  ``\<open>abbrev\<close>~\<^verbatim>\<open>=\<close>~\<open>text\<close>'' pairs. The replacement \<open>text\<close> may consist of more
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1228
  than just one symbol; otherwise the meaning is the same as a symbol
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1229
  specification ``\<open>sym\<close>~\<^verbatim>\<open>abbrev:\<close>~\<open>abbrev\<close>'' within @{file_unchecked
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1230
  "etc/symbols"}.
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1231
20c1321378db support additional abbrevs;
wenzelm
parents: 61656
diff changeset
  1232
  \<^medskip>
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1233
  Symbol completion depends on the semantic language context
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1234
  (\secref{sec:completion-context}), to enable or disable that aspect for a
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1235
  particular sub-language of Isabelle. For example, symbol completion is
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1236
  suppressed within document source to avoid confusion with {\LaTeX} macros
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1237
  that use similar notation.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1238
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1239
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1240
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1241
subsubsection \<open>Name-space entries\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1242
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1243
text \<open>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1244
  This is genuine semantic completion, using information from the prover, so
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1245
  it requires some delay. A \<^emph>\<open>failed name-space lookup\<close> produces an error
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1246
  message that is annotated with a list of alternative names that are legal.
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1247
  The list of results is truncated according to the system option
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1248
  @{system_option_ref completion_limit}. The completion mechanism takes this
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1249
  into account when collecting information on the prover side.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1250
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1251
  Already recognized names are \<^emph>\<open>not\<close> completed further, but completion may be
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1252
  extended by appending a suffix of underscores. This provokes a failed
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1253
  lookup, and another completion attempt while ignoring the underscores. For
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1254
  example, in a name space where \<^verbatim>\<open>foo\<close> and \<^verbatim>\<open>foobar\<close> are known, the input
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1255
  \<^verbatim>\<open>foo\<close> remains unchanged, but \<^verbatim>\<open>foo_\<close> may be completed to \<^verbatim>\<open>foo\<close> or
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1256
  \<^verbatim>\<open>foobar\<close>.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1257
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1258
  The special identifier ``\<^verbatim>\<open>__\<close>'' serves as a wild-card for arbitrary
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1259
  completion: it exposes the name-space content to the completion mechanism
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1260
  (truncated according to @{system_option completion_limit}). This is
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1261
  occasionally useful to explore an unknown name-space, e.g.\ in some
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1262
  template.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1263
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1264
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1265
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1266
subsubsection \<open>File-system paths\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1267
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1268
text \<open>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1269
  Depending on prover markup about file-system path specifications in the
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1270
  source text, e.g.\ for the argument of a load command
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1271
  (\secref{sec:aux-files}), the completion mechanism explores the directory
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1272
  content and offers the result as completion popup. Relative path
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1273
  specifications are understood wrt.\ the \<^emph>\<open>master directory\<close> of the document
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1274
  node (\secref{sec:buffer-node}) of the enclosing editor buffer; this
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1275
  requires a proper theory, not an auxiliary file.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1276
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1277
  A suffix of slashes may be used to continue the exploration of an already
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1278
  recognized directory name.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1279
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1280
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1281
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1282
subsubsection \<open>Spell-checking\<close>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1283
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1284
text \<open>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1285
  The spell-checker combines semantic markup from the prover (regions of plain
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1286
  words) with static dictionaries (word lists) that are known to the editor.
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1287
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1288
  Unknown words are underlined in the text, using @{system_option_ref
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1289
  spell_checker_color} (blue by default). This is not an error, but a hint to
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1290
  the user that some action may be taken. The jEdit context menu provides
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1291
  various actions, as far as applicable:
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1292
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1293
  \<^medskip>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1294
  \begin{tabular}{l}
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1295
  @{action_ref "isabelle.complete-word"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1296
  @{action_ref "isabelle.exclude-word"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1297
  @{action_ref "isabelle.exclude-word-permanently"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1298
  @{action_ref "isabelle.include-word"} \\
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1299
  @{action_ref "isabelle.include-word-permanently"} \\
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1300
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1301
  \<^medskip>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1302
57329
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1303
  Instead of the specific @{action_ref "isabelle.complete-word"}, it is also
397062213224 added Index;
wenzelm
parents: 57328
diff changeset
  1304
  possible to use the generic @{action_ref "isabelle.complete"} with its
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1305
  default keyboard shortcut \<^verbatim>\<open>C+b\<close>.
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1306
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1307
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1308
  Dictionary lookup uses some educated guesses about lower-case, upper-case,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1309
  and capitalized words. This is oriented on common use in English, where this
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1310
  aspect is not decisive for proper spelling, in contrast to German, for
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1311
  example.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1312
\<close>
57328
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1313
5765ce647ca4 more on "Completion";
wenzelm
parents: 57327
diff changeset
  1314
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1315
subsection \<open>Semantic completion context \label{sec:completion-context}\<close>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1316
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1317
text \<open>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1318
  Completion depends on a semantic context that is provided by the prover,
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1319
  although with some delay, because at least a full PIDE protocol round-trip
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1320
  is required. Until that information becomes available in the PIDE
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1321
  document-model, the default context is given by the outer syntax of the
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1322
  editor mode (see also \secref{sec:buffer-node}).
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1323
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1324
  The semantic \<^emph>\<open>language context\<close> provides information about nested
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1325
  sub-languages of Isabelle: keywords are only completed for outer syntax,
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1326
  symbols or antiquotations for languages that support them. E.g.\ there is no
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1327
  symbol completion for ML source, but within ML strings, comments,
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1328
  antiquotations.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1329
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1330
  The prover may produce \<^emph>\<open>no completion\<close> markup in exceptional situations, to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1331
  tell that some language keywords should be excluded from further completion
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1332
  attempts. For example, \<^verbatim>\<open>:\<close> within accepted Isar syntax looses its meaning
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1333
  as abbreviation for symbol \<open>\<in>\<close>.
57589
e0e4ac981cf1 always complete explicit symbols;
wenzelm
parents: 57425
diff changeset
  1334
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1335
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1336
  The completion context is \<^emph>\<open>ignored\<close> for built-in templates and symbols in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1337
  their explicit form ``\<^verbatim>\<open>\<foobar>\<close>''; see also
57589
e0e4ac981cf1 always complete explicit symbols;
wenzelm
parents: 57425
diff changeset
  1338
  \secref{sec:completion-varieties}. This allows to complete within broken
e0e4ac981cf1 always complete explicit symbols;
wenzelm
parents: 57425
diff changeset
  1339
  input that escapes its normal semantic context, e.g.\ antiquotations or
e0e4ac981cf1 always complete explicit symbols;
wenzelm
parents: 57425
diff changeset
  1340
  string literals in ML, which do not allow arbitrary backslash sequences.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1341
\<close>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1342
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1343
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1344
subsection \<open>Input events \label{sec:completion-input}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1345
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1346
text \<open>
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1347
  Completion is triggered by certain events produced by the user, with
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1348
  optional delay after keyboard input according to @{system_option
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1349
  jedit_completion_delay}.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1350
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1351
  \<^descr>[Explicit completion] works via action @{action_ref "isabelle.complete"}
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1352
  with keyboard shortcut \<^verbatim>\<open>C+b\<close>. This overrides the shortcut for @{action_ref
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1353
  "complete-word"} in jEdit, but it is possible to restore the original jEdit
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1354
  keyboard mapping of @{action "complete-word"} via \<^emph>\<open>Global Options~/
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1355
  Shortcuts\<close> and invent a different one for @{action "isabelle.complete"}.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1356
61439
2bf52eec4e8a more symbols;
wenzelm
parents: 61415
diff changeset
  1357
  \<^descr>[Explicit spell-checker completion] works via @{action_ref
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1358
  "isabelle.complete-word"}, which is exposed in the jEdit context menu, if
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1359
  the mouse points to a word that the spell-checker can complete.
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1360
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1361
  \<^descr>[Implicit completion] works via regular keyboard input of the editor. It
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1362
  depends on further side-conditions:
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1363
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1364
    \<^enum> The system option @{system_option_ref jedit_completion} needs to be
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1365
    enabled (default).
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1366
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1367
    \<^enum> Completion of syntax keywords requires at least 3 relevant characters in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1368
    the text.
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1369
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1370
    \<^enum> The system option @{system_option_ref jedit_completion_delay} determines
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1371
    an additional delay (0.5 by default), before opening a completion popup.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1372
    The delay gives the prover a chance to provide semantic completion
61458
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1373
    information, notably the context (\secref{sec:completion-context}).
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1374
61458
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1375
    \<^enum> The system option @{system_option_ref jedit_completion_immediate}
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1376
    (enabled by default) controls whether replacement text should be inserted
987533262fc2 Markdown support in document text;
wenzelm
parents: 61439
diff changeset
  1377
    immediately without popup, regardless of @{system_option
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1378
    jedit_completion_delay}. This aggressive mode of completion is restricted
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1379
    to Isabelle symbols and their abbreviations (\secref{sec:symbols}).
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1380
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1381
    \<^enum> Completion of symbol abbreviations with only one relevant character in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1382
    the text always enforces an explicit popup, regardless of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1383
    @{system_option_ref jedit_completion_immediate}.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1384
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1385
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1386
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1387
subsection \<open>Completion popup \label{sec:completion-popup}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1388
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1389
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1390
  A \<^emph>\<open>completion popup\<close> is a minimally invasive GUI component over the text
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1391
  area that offers a selection of completion items to be inserted into the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1392
  text, e.g.\ by mouse clicks. Items are sorted dynamically, according to the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1393
  frequency of selection, with persistent history. The popup may interpret
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1394
  special keys \<^verbatim>\<open>ENTER\<close>, \<^verbatim>\<open>TAB\<close>, \<^verbatim>\<open>ESCAPE\<close>, \<^verbatim>\<open>UP\<close>, \<^verbatim>\<open>DOWN\<close>, \<^verbatim>\<open>PAGE_UP\<close>,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1395
  \<^verbatim>\<open>PAGE_DOWN\<close>, but all other key events are passed to the underlying text
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1396
  area. This allows to ignore unwanted completions most of the time and
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1397
  continue typing quickly. Thus the popup serves as a mechanism of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1398
  confirmation of proposed items, but the default is to continue without
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1399
  completion.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1400
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1401
  The meaning of special keys is as follows:
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1402
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1403
  \<^medskip>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1404
  \begin{tabular}{ll}
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1405
  \<^bold>\<open>key\<close> & \<^bold>\<open>action\<close> \\\hline
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1406
  \<^verbatim>\<open>ENTER\<close> & select completion (if @{system_option jedit_completion_select_enter}) \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1407
  \<^verbatim>\<open>TAB\<close> & select completion (if @{system_option jedit_completion_select_tab}) \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1408
  \<^verbatim>\<open>ESCAPE\<close> & dismiss popup \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1409
  \<^verbatim>\<open>UP\<close> & move up one item \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1410
  \<^verbatim>\<open>DOWN\<close> & move down one item \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1411
  \<^verbatim>\<open>PAGE_UP\<close> & move up one page of items \\
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1412
  \<^verbatim>\<open>PAGE_DOWN\<close> & move down one page of items \\
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1413
  \end{tabular}
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1414
  \<^medskip>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1415
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1416
  Movement within the popup is only active for multiple items. Otherwise the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1417
  corresponding key event retains its standard meaning within the underlying
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1418
  text area.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1419
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1420
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1421
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1422
subsection \<open>Insertion \label{sec:completion-insert}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1423
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1424
text \<open>
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1425
  Completion may first propose replacements to be selected (via a popup), or
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1426
  replace text immediately in certain situations and depending on certain
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1427
  options like @{system_option jedit_completion_immediate}. In any case,
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1428
  insertion works uniformly, by imitating normal jEdit text insertion,
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1429
  depending on the state of the \<^emph>\<open>text selection\<close>. Isabelle/jEdit tries to
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1430
  accommodate the most common forms of advanced selections in jEdit, but not
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1431
  all combinations make sense. At least the following important cases are
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1432
  well-defined:
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1433
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1434
    \<^descr>[No selection.] The original is removed and the replacement inserted,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1435
    depending on the caret position.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1436
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1437
    \<^descr>[Rectangular selection of zero width.] This special case is treated by
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1438
    jEdit as ``tall caret'' and insertion of completion imitates its normal
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1439
    behaviour: separate copies of the replacement are inserted for each line
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1440
    of the selection.
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1441
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1442
    \<^descr>[Other rectangular selection or multiple selections.] Here the original
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1443
    is removed and the replacement is inserted for each line (or segment) of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1444
    the selection.
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1445
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1446
  Support for multiple selections is particularly useful for \<^emph>\<open>HyperSearch\<close>:
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1447
  clicking on one of the items in the \<^emph>\<open>HyperSearch Results\<close> window makes
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1448
  jEdit select all its occurrences in the corresponding line of text. Then
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1449
  explicit completion can be invoked via \<^verbatim>\<open>C+b\<close>, e.g.\ to replace occurrences
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1450
  of \<^verbatim>\<open>-->\<close> by \<open>\<longrightarrow>\<close>.
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1451
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1452
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1453
  Insertion works by removing and inserting pieces of text from the buffer.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1454
  This counts as one atomic operation on the jEdit history. Thus unintended
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1455
  completions may be reverted by the regular @{action undo} action of jEdit.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1456
  According to normal jEdit policies, the recovered text after @{action undo}
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1457
  is selected: \<^verbatim>\<open>ESCAPE\<close> is required to reset the selection and to continue
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1458
  typing more text.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1459
\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1460
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1461
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1462
subsection \<open>Options \label{sec:completion-options}\<close>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1463
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1464
text \<open>
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1465
  This is a summary of Isabelle/Scala system options that are relevant for
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1466
  completion. They may be configured in \<^emph>\<open>Plugin Options~/ Isabelle~/ General\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1467
  as usual.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1468
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1469
  \<^item> @{system_option_def completion_limit} specifies the maximum number of
60257
wenzelm
parents: 60256
diff changeset
  1470
  items for various semantic completion operations (name-space entries etc.)
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1471
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1472
  \<^item> @{system_option_def jedit_completion} guards implicit completion via
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1473
  regular jEdit key events (\secref{sec:completion-input}): it allows to
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1474
  disable implicit completion altogether.
57324
8c0322732f3e more on "Completion";
wenzelm
parents: 57323
diff changeset
  1475
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1476
  \<^item> @{system_option_def jedit_completion_select_enter} and @{system_option_def
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1477
  jedit_completion_select_tab} enable keys to select a completion item from
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1478
  the popup (\secref{sec:completion-popup}). Note that a regular mouse click
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1479
  on the list of items is always possible.
57833
2c2bae3da1c2 completion popup supports both ENTER and TAB (default);
wenzelm
parents: 57822
diff changeset
  1480
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1481
  \<^item> @{system_option_def jedit_completion_context} specifies whether the
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1482
  language context provided by the prover should be used at all. Disabling
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1483
  that option makes completion less ``semantic''. Note that incomplete or
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1484
  severely broken input may cause some disagreement of the prover and the user
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1485
  about the intended language context.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1486
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1487
  \<^item> @{system_option_def jedit_completion_delay} and @{system_option_def
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1488
  jedit_completion_immediate} determine the handling of keyboard events for
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1489
  implicit completion (\secref{sec:completion-input}).
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1490
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1491
  A @{system_option jedit_completion_delay}~\<^verbatim>\<open>> 0\<close> postpones the processing of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1492
  key events, until after the user has stopped typing for the given time span,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1493
  but @{system_option jedit_completion_immediate}~\<^verbatim>\<open>"= true\<close> means that
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1494
  abbreviations of Isabelle symbols are handled nonetheless.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1495
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1496
  \<^item> @{system_option_def jedit_completion_path_ignore} specifies ``glob''
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1497
  patterns to ignore in file-system path completion (separated by colons),
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1498
  e.g.\ backup files ending with tilde.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1499
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1500
  \<^item> @{system_option_def spell_checker} is a global guard for all spell-checker
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1501
  operations: it allows to disable that mechanism altogether.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1502
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1503
  \<^item> @{system_option_def spell_checker_dictionary} determines the current
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1504
  dictionary, taken from the colon-separated list in the settings variable
57333
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1505
  @{setting_def JORTHO_DICTIONARIES}. There are jEdit actions to specify local
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1506
  updates to a dictionary, by including or excluding words. The result of
d58b7f7d81db more on "Completion";
wenzelm
parents: 57332
diff changeset
  1507
  permanent dictionary updates is stored in the directory @{file_unchecked
57335
f911187ada43 misc tuning;
wenzelm
parents: 57334
diff changeset
  1508
  "$ISABELLE_HOME_USER/dictionaries"}, in a separate file for each dictionary.
57332
da630c4fd92b more on "Completion";
wenzelm
parents: 57331
diff changeset
  1509
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1510
  \<^item> @{system_option_def spell_checker_elements} specifies a comma-separated
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1511
  list of markup elements that delimit words in the source that is subject to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1512
  spell-checking, including various forms of comments.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1513
\<close>
54361
wenzelm
parents: 54360
diff changeset
  1514
wenzelm
parents: 54360
diff changeset
  1515
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1516
section \<open>Automatically tried tools \label{sec:auto-tools}\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1517
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1518
text \<open>
57325
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1519
  Continuous document processing works asynchronously in the background.
5e7488f4309e more on "Completion";
wenzelm
parents: 57324
diff changeset
  1520
  Visible document source that has been evaluated may get augmented by
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1521
  additional results of \<^emph>\<open>asynchronous print functions\<close>. The canonical example
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1522
  is proof state output, which is always enabled. More heavy-weight print
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1523
  functions may be applied, in order to prove or disprove parts of the formal
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1524
  text by other means.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1525
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1526
  Isabelle/HOL provides various automatically tried tools that operate on
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1527
  outermost goal statements (e.g.\ @{command lemma}, @{command theorem}),
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1528
  independently of the state of the current proof attempt. They work
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1529
  implicitly without any arguments. Results are output as \<^emph>\<open>information
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1530
  messages\<close>, which are indicated in the text area by blue squiggles and a blue
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1531
  information sign in the gutter (see \figref{fig:auto-tools}). The message
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1532
  content may be shown as for other output (see also \secref{sec:output}).
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1533
  Some tools produce output with \<^emph>\<open>sendback\<close> markup, which means that clicking
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1534
  on certain parts of the output inserts that text into the source in the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1535
  proper place.
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1536
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1537
  \begin{figure}[!htb]
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1538
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1539
  \includegraphics[scale=0.333]{auto-tools}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1540
  \end{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1541
  \caption{Result of automatically tried tools}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1542
  \label{fig:auto-tools}
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1543
  \end{figure}
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1544
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1545
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1546
  The following Isabelle system options control the behavior of automatically
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1547
  tried tools (see also the jEdit dialog window \<^emph>\<open>Plugin Options~/ Isabelle~/
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1548
  General~/ Automatically tried tools\<close>):
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1549
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1550
  \<^item> @{system_option_ref auto_methods} controls automatic use of a combination
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1551
  of standard proof methods (@{method auto}, @{method simp}, @{method blast},
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1552
  etc.). This corresponds to the Isar command @{command_ref "try0"} @{cite
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1553
  "isabelle-isar-ref"}.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1554
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1555
  The tool is disabled by default, since unparameterized invocation of
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1556
  standard proof methods often consumes substantial CPU resources without
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1557
  leading to success.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1558
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1559
  \<^item> @{system_option_ref auto_nitpick} controls a slightly reduced version of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1560
  @{command_ref nitpick}, which tests for counterexamples using first-order
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1561
  relational logic. See also the Nitpick manual @{cite "isabelle-nitpick"}.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1562
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1563
  This tool is disabled by default, due to the extra overhead of invoking an
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1564
  external Java process for each attempt to disprove a subgoal.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1565
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1566
  \<^item> @{system_option_ref auto_quickcheck} controls automatic use of
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1567
  @{command_ref quickcheck}, which tests for counterexamples using a series of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1568
  assignments for free variables of a subgoal.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1569
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1570
  This tool is \<^emph>\<open>enabled\<close> by default. It requires little overhead, but is a
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1571
  bit weaker than @{command nitpick}.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1572
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1573
  \<^item> @{system_option_ref auto_sledgehammer} controls a significantly reduced
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1574
  version of @{command_ref sledgehammer}, which attempts to prove a subgoal
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1575
  using external automatic provers. See also the Sledgehammer manual @{cite
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1576
  "isabelle-sledgehammer"}.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1577
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1578
  This tool is disabled by default, due to the relatively heavy nature of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1579
  Sledgehammer.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1580
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1581
  \<^item> @{system_option_ref auto_solve_direct} controls automatic use of
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1582
  @{command_ref solve_direct}, which checks whether the current subgoals can
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1583
  be solved directly by an existing theorem. This also helps to detect
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1584
  duplicate lemmas.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1585
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1586
  This tool is \<^emph>\<open>enabled\<close> by default.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1587
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1588
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1589
  Invocation of automatically tried tools is subject to some global policies
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1590
  of parallel execution, which may be configured as follows:
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1591
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1592
  \<^item> @{system_option_ref auto_time_limit} (default 2.0) determines the timeout
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1593
  (in seconds) for each tool execution.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1594
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1595
  \<^item> @{system_option_ref auto_time_start} (default 1.0) determines the start
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1596
  delay (in seconds) for automatically tried tools, after the main command
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1597
  evaluation is finished.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1598
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1599
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1600
  Each tool is submitted independently to the pool of parallel execution tasks
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1601
  in Isabelle/ML, using hardwired priorities according to its relative
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1602
  ``heaviness''. The main stages of evaluation and printing of proof states
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1603
  take precedence, but an already running tool is not canceled and may thus
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1604
  reduce reactivity of proof document processing.
54354
4e6defdc24ac more on automatically tried tools;
wenzelm
parents: 54353
diff changeset
  1605
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1606
  Users should experiment how the available CPU resources (number of cores)
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1607
  are best invested to get additional feedback from prover in the background,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1608
  by using a selection of weaker or stronger tools.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1609
\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1610
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1611
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1612
section \<open>Sledgehammer \label{sec:sledgehammer}\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1613
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1614
text \<open>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1615
  The \<^emph>\<open>Sledgehammer\<close> panel (\figref{fig:sledgehammer}) provides a view on
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1616
  some independent execution of the Isar command @{command_ref sledgehammer},
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1617
  with process indicator (spinning wheel) and GUI elements for important
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1618
  Sledgehammer arguments and options. Any number of Sledgehammer panels may be
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1619
  active, according to the standard policies of Dockable Window Management in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1620
  jEdit. Closing such windows also cancels the corresponding prover tasks.
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1621
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1622
  \begin{figure}[!htb]
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1623
  \begin{center}
57312
afbc20986435 updated screenshots;
wenzelm
parents: 57311
diff changeset
  1624
  \includegraphics[scale=0.333]{sledgehammer}
54356
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1625
  \end{center}
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1626
  \caption{An instance of the Sledgehammer panel}
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1627
  \label{fig:sledgehammer}
9538f51da542 more screenshots;
wenzelm
parents: 54355
diff changeset
  1628
  \end{figure}
54355
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1629
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1630
  The \<^emph>\<open>Apply\<close> button attaches a fresh invocation of @{command sledgehammer}
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1631
  to the command where the cursor is pointing in the text --- this should be
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1632
  some pending proof problem. Further buttons like \<^emph>\<open>Cancel\<close> and \<^emph>\<open>Locate\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1633
  help to manage the running process.
54355
08cbb9461b48 more on Sledgehammer;
wenzelm
parents: 54354
diff changeset
  1634
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1635
  Results appear incrementally in the output window of the panel. Proposed
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1636
  proof snippets are marked-up as \<^emph>\<open>sendback\<close>, which means a single mouse
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1637
  click inserts the text into a suitable place of the original source. Some
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1638
  manual editing may be required nonetheless, say to remove earlier proof
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1639
  attempts.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1640
\<close>
54353
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1641
6692c355ebc1 more on prover output;
wenzelm
parents: 54352
diff changeset
  1642
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1643
chapter \<open>Isabelle document preparation\<close>
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1644
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1645
text \<open>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1646
  The ultimate purpose of Isabelle is to produce nicely rendered documents
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1647
  with the Isabelle document preparation system, which is based on {\LaTeX};
60270
wenzelm
parents: 60264
diff changeset
  1648
  see also @{cite "isabelle-system" and "isabelle-isar-ref"}. Isabelle/jEdit
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1649
  provides some additional support for document editing.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1650
\<close>
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1651
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1652
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1653
section \<open>Document outline\<close>
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1654
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1655
text \<open>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1656
  Theory sources may contain document markup commands, such as @{command_ref
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1657
  chapter}, @{command_ref section}, @{command subsection}. The Isabelle
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1658
  SideKick parser (\secref{sec:sidekick}) represents this document outline as
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1659
  structured tree view, with formal statements and proofs nested inside; see
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1660
  \figref{fig:sidekick-document}.
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1661
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1662
  \begin{figure}[!htb]
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1663
  \begin{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1664
  \includegraphics[scale=0.333]{sidekick-document}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1665
  \end{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1666
  \caption{Isabelle document outline via SideKick tree view}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1667
  \label{fig:sidekick-document}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1668
  \end{figure}
60264
96f8092fdd77 more documentation;
wenzelm
parents: 60257
diff changeset
  1669
96f8092fdd77 more documentation;
wenzelm
parents: 60257
diff changeset
  1670
  It is also possible to use text folding according to this structure, by
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1671
  adjusting \<^emph>\<open>Utilities / Buffer Options / Folding mode\<close> of jEdit. The default
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1672
  mode \<^verbatim>\<open>isabelle\<close> uses the structure of formal definitions, statements, and
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1673
  proofs. The alternative mode \<^verbatim>\<open>sidekick\<close> uses the document structure of the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1674
  SideKick parser, as explained above.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1675
\<close>
60264
96f8092fdd77 more documentation;
wenzelm
parents: 60257
diff changeset
  1676
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1677
62154
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1678
section \<open>Markdown structure\<close>
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1679
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1680
text \<open>
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1681
  FIXME
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1682
  \figref{fig:markdown-document}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1683
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1684
  \begin{figure}[!htb]
62154
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1685
  \begin{center}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1686
  \includegraphics[scale=0.333]{markdown-document}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1687
  \end{center}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1688
  \caption{Markdown structure within document text}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1689
  \label{fig:markdown-document}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1690
  \end{figure}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1691
\<close>
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1692
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1693
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1694
section \<open>Citations and Bib{\TeX} entries\<close>
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1695
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1696
text \<open>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1697
  Citations are managed by {\LaTeX} and Bib{\TeX} in \<^verbatim>\<open>.bib\<close> files. The
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1698
  Isabelle session build process and the @{tool latex} tool @{cite
60270
wenzelm
parents: 60264
diff changeset
  1699
  "isabelle-system"} are smart enough to assemble the result, based on the
60257
wenzelm
parents: 60256
diff changeset
  1700
  session directory layout.
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1701
61493
0debd22f0c0e isabelle update_cartouches -t;
wenzelm
parents: 61483
diff changeset
  1702
  The document antiquotation \<open>@{cite}\<close> is described in @{cite
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1703
  "isabelle-isar-ref"}. Within the Prover IDE it provides semantic markup for
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1704
  tooltips, hyperlinks, and completion for Bib{\TeX} database entries.
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1705
  Isabelle/jEdit does \<^emph>\<open>not\<close> know about the actual Bib{\TeX} environment used
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1706
  in {\LaTeX} batch-mode, but it can take citations from those \<^verbatim>\<open>.bib\<close> files
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1707
  that happen to be open in the editor; see \figref{fig:cite-completion}.
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1708
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1709
  \begin{figure}[!htb]
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1710
  \begin{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1711
  \includegraphics[scale=0.333]{cite-completion}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1712
  \end{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1713
  \caption{Semantic completion of citations from open Bib{\TeX} files}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1714
  \label{fig:cite-completion}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1715
  \end{figure}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1716
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1717
  Isabelle/jEdit also provides some support for editing \<^verbatim>\<open>.bib\<close> files
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1718
  themselves. There is syntax highlighting based on entry types (according to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1719
  standard Bib{\TeX} styles), a context-menu to compose entries
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1720
  systematically, and a SideKick tree view of the overall content; see
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1721
  \figref{fig:bibtex-mode}.
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1722
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1723
  \begin{figure}[!htb]
60255
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1724
  \begin{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1725
  \includegraphics[scale=0.333]{bibtex-mode}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1726
  \end{center}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1727
  \caption{Bib{\TeX} mode with context menu and SideKick tree view}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1728
  \label{fig:bibtex-mode}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1729
  \end{figure}
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1730
\<close>
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1731
0466bd194d74 more on Isabelle document preparation and bibtex files;
wenzelm
parents: 58618
diff changeset
  1732
62154
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1733
chapter \<open>ML debugger\<close>
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1734
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1735
text \<open>
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1736
  FIXME
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1737
  \figref{fig:ml-debugger}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1738
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1739
  \begin{figure}[!htb]
62154
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1740
  \begin{center}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1741
  \includegraphics[scale=0.333]{ml-debugger}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1742
  \end{center}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1743
  \caption{ML debugger}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1744
  \label{fig:ml-debugger}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1745
  \end{figure}
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1746
\<close>
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1747
b855771b3979 updated old screenshots, added new screenshots;
wenzelm
parents: 62039
diff changeset
  1748
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1749
chapter \<open>Miscellaneous tools\<close>
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1750
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1751
section \<open>Timing\<close>
54359
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1752
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1753
text \<open>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1754
  Managed evaluation of commands within PIDE documents includes timing
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1755
  information, which consists of elapsed (wall-clock) time, CPU time, and GC
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1756
  (garbage collection) time. Note that in a multithreaded system it is
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1757
  difficult to measure execution time precisely: elapsed time is closer to the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1758
  real requirements of runtime resources than CPU or GC time, which are both
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1759
  subject to influences from the parallel environment that are outside the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1760
  scope of the current command transaction.
54359
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1761
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1762
  The \<^emph>\<open>Timing\<close> panel provides an overview of cumulative command timings for
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1763
  each document node. Commands with elapsed time below the given threshold are
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1764
  ignored in the grand total. Nodes are sorted according to their overall
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1765
  timing. For the document node that corresponds to the current buffer,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1766
  individual command timings are shown as well. A double-click on a theory
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1767
  node or command moves the editor focus to that particular source position.
54359
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1768
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1769
  It is also possible to reveal individual timing information via some tooltip
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1770
  for the corresponding command keyword, using the technique of mouse hovering
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1771
  with \<^verbatim>\<open>CONTROL\<close>~/ \<^verbatim>\<open>COMMAND\<close> modifier key as explained in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1772
  \secref{sec:tooltips-hyperlinks}. Actual display of timing depends on the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1773
  global option @{system_option_ref jedit_timing_threshold}, which can be
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1774
  configured in \<^emph>\<open>Plugin Options~/ Isabelle~/ General\<close>.
54360
9d19298d3650 more on Monitor panel;
wenzelm
parents: 54359
diff changeset
  1775
61415
55e73b352287 more symbols;
wenzelm
parents: 61408
diff changeset
  1776
  \<^medskip>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1777
  The \<^emph>\<open>Monitor\<close> panel visualizes various data collections about recent
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1778
  activity of the Isabelle/ML task farm and the underlying ML runtime system.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1779
  The display is continuously updated according to @{system_option_ref
57869
9665f79a7181 improved monitor panel;
wenzelm
parents: 57833
diff changeset
  1780
  editor_chart_delay}. Note that the painting of the chart takes considerable
9665f79a7181 improved monitor panel;
wenzelm
parents: 57833
diff changeset
  1781
  runtime itself --- on the Java Virtual Machine that runs Isabelle/Scala, not
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1782
  Isabelle/ML. Internally, the Isabelle/Scala module \<^verbatim>\<open>isabelle.ML_Statistics\<close>
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1783
  provides further access to statistics of Isabelle/ML.
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1784
\<close>
54359
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1785
e649dff217ae more on Timing;
wenzelm
parents: 54358
diff changeset
  1786
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1787
section \<open>Low-level output\<close>
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1788
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1789
text \<open>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1790
  Prover output is normally shown directly in the main text area or secondary
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1791
  \<^emph>\<open>Output\<close> panels, as explained in \secref{sec:output}.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1792
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1793
  Beyond this, it is occasionally useful to inspect low-level output channels
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1794
  via some of the following additional panels:
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1795
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1796
  \<^item> \<^emph>\<open>Protocol\<close> shows internal messages between the Isabelle/Scala and
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1797
  Isabelle/ML side of the PIDE document editing protocol. Recording of
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1798
  messages starts with the first activation of the corresponding dockable
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1799
  window; earlier messages are lost.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1800
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1801
  Actual display of protocol messages causes considerable slowdown, so it is
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1802
  important to undock all \<^emph>\<open>Protocol\<close> panels for production work.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1803
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1804
  \<^item> \<^emph>\<open>Raw Output\<close> shows chunks of text from the \<^verbatim>\<open>stdout\<close> and \<^verbatim>\<open>stderr\<close>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1805
  channels of the prover process. Recording of output starts with the first
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1806
  activation of the corresponding dockable window; earlier output is lost.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1807
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1808
  The implicit stateful nature of physical I/O channels makes it difficult to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1809
  relate raw output to the actual command from where it was originating.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1810
  Parallel execution may add to the confusion. Peeking at physical process I/O
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1811
  is only the last resort to diagnose problems with tools that are not PIDE
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1812
  compliant.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1813
57310
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1814
  Under normal circumstances, prover output always works via managed message
da107539996f misc tuning and updates;
wenzelm
parents: 56466
diff changeset
  1815
  channels (corresponding to @{ML writeln}, @{ML warning}, @{ML
57420
8103a3f6f342 misc tuning;
wenzelm
parents: 57415
diff changeset
  1816
  Output.error_message} in Isabelle/ML), which are displayed by regular means
60257
wenzelm
parents: 60256
diff changeset
  1817
  within the document model (\secref{sec:output}). Unhandled Isabelle/ML
wenzelm
parents: 60256
diff changeset
  1818
  exceptions are printed by the system via @{ML Output.error_message}.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1819
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1820
  \<^item> \<^emph>\<open>Syslog\<close> shows system messages that might be relevant to diagnose
60257
wenzelm
parents: 60256
diff changeset
  1821
  problems with the startup or shutdown phase of the prover process; this also
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1822
  includes raw output on \<^verbatim>\<open>stderr\<close>. Isabelle/ML also provides an explicit @{ML
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1823
  Output.system_message} operation, which is occasionally useful for
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1824
  diagnostic purposes within the system infrastructure itself.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1825
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1826
  A limited amount of syslog messages are buffered, independently of the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1827
  docking state of the \<^emph>\<open>Syslog\<close> panel. This allows to diagnose serious
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1828
  problems with Isabelle/PIDE process management, outside of the actual
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1829
  protocol layer.
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1830
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1831
  Under normal situations, such low-level system output can be ignored.
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1832
\<close>
54358
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1833
0f50303e899f more on miscellaneous tools;
wenzelm
parents: 54357
diff changeset
  1834
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1835
chapter \<open>Known problems and workarounds \label{sec:problems}\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1836
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1837
text \<open>
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1838
  \<^item> \<^bold>\<open>Problem:\<close> Odd behavior of some diagnostic commands with global
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1839
  side-effects, like writing a physical file.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1840
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1841
  \<^bold>\<open>Workaround:\<close> Copy/paste complete command text from elsewhere, or disable
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1842
  continuous checking temporarily.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1843
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1844
  \<^item> \<^bold>\<open>Problem:\<close> No direct support to remove document nodes from the collection
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1845
  of theories.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1846
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1847
  \<^bold>\<open>Workaround:\<close> Clear the buffer content of unused files and close \<^emph>\<open>without\<close>
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1848
  saving changes.
54330
wenzelm
parents: 54329
diff changeset
  1849
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1850
  \<^item> \<^bold>\<open>Problem:\<close> Keyboard shortcuts \<^verbatim>\<open>C+PLUS\<close> and \<^verbatim>\<open>C+MINUS\<close> for adjusting the
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1851
  editor font size depend on platform details and national keyboards.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1852
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1853
  \<^bold>\<open>Workaround:\<close> Rebind keys via \<^emph>\<open>Global Options~/ Shortcuts\<close>.
54330
wenzelm
parents: 54329
diff changeset
  1854
61503
28e788ca2c5d more control symbols;
wenzelm
parents: 61493
diff changeset
  1855
  \<^item> \<^bold>\<open>Problem:\<close> The Mac OS X key sequence \<^verbatim>\<open>COMMAND+COMMA\<close> for application
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1856
  \<^emph>\<open>Preferences\<close> is in conflict with the jEdit default keyboard shortcut for
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1857
  \<^emph>\<open>Incremental Search Bar\<close> (action @{action_ref "quick-search"}).
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1858
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1859
  \<^bold>\<open>Workaround:\<close> Rebind key via \<^emph>\<open>Global Options~/ Shortcuts\<close> according to
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1860
  national keyboard, e.g.\ \<^verbatim>\<open>COMMAND+SLASH\<close> on English ones.
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1861
61522
4108f91ca810 workaround for problem with C-1, C-2, C-3 seen on Slovak QWERTY keyboard;
wenzelm
parents: 61512
diff changeset
  1862
  \<^item> \<^bold>\<open>Problem:\<close> On Mac OS X with native Apple look-and-feel, some exotic
4108f91ca810 workaround for problem with C-1, C-2, C-3 seen on Slovak QWERTY keyboard;
wenzelm
parents: 61512
diff changeset
  1863
  national keyboards may cause a conflict of menu accelerator keys with
4108f91ca810 workaround for problem with C-1, C-2, C-3 seen on Slovak QWERTY keyboard;
wenzelm
parents: 61512
diff changeset
  1864
  regular jEdit key bindings. This leads to duplicate execution of the
4108f91ca810 workaround for problem with C-1, C-2, C-3 seen on Slovak QWERTY keyboard;
wenzelm
parents: 61512
diff changeset
  1865
  corresponding jEdit action.
4108f91ca810 workaround for problem with C-1, C-2, C-3 seen on Slovak QWERTY keyboard;
wenzelm
parents: 61512
diff changeset
  1866
4108f91ca810 workaround for problem with C-1, C-2, C-3 seen on Slovak QWERTY keyboard;
wenzelm
parents: 61512
diff changeset
  1867
  \<^bold>\<open>Workaround:\<close> Disable the native Apple menu bar via Java runtime option
4108f91ca810 workaround for problem with C-1, C-2, C-3 seen on Slovak QWERTY keyboard;
wenzelm
parents: 61512
diff changeset
  1868
  \<^verbatim>\<open>-Dapple.laf.useScreenMenuBar=false\<close>.
4108f91ca810 workaround for problem with C-1, C-2, C-3 seen on Slovak QWERTY keyboard;
wenzelm
parents: 61512
diff changeset
  1869
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1870
  \<^item> \<^bold>\<open>Problem:\<close> Mac OS X system fonts sometimes lead to character drop-outs in
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1871
  the main text area.
54349
fd5ddf2bce76 more on problems and workarounds;
wenzelm
parents: 54348
diff changeset
  1872
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1873
  \<^bold>\<open>Workaround:\<close> Use the default \<^verbatim>\<open>IsabelleText\<close> font. (Do not install that
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1874
  font on the system.)
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1875
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1876
  \<^item> \<^bold>\<open>Problem:\<close> Some Linux/X11 input methods such as IBus tend to disrupt key
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1877
  event handling of Java/AWT/Swing.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
  1878
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1879
  \<^bold>\<open>Workaround:\<close> Do not use X11 input methods. Note that environment variable
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1880
  \<^verbatim>\<open>XMODIFIERS\<close> is reset by default within Isabelle settings.
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1881
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1882
  \<^item> \<^bold>\<open>Problem:\<close> Some Linux/X11 window managers that are not ``re-parenting''
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1883
  cause problems with additional windows opened by Java. This affects either
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1884
  historic or neo-minimalistic window managers like \<^verbatim>\<open>awesome\<close> or \<^verbatim>\<open>xmonad\<close>.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
  1885
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1886
  \<^bold>\<open>Workaround:\<close> Use a regular re-parenting X11 window manager.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
  1887
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1888
  \<^item> \<^bold>\<open>Problem:\<close> Various forks of Linux/X11 window managers and desktop
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1889
  environments (like Gnome) disrupt the handling of menu popups and mouse
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1890
  positions of Java/AWT/Swing.
54329
e0fa4bd16c80 misc tuning;
wenzelm
parents: 54323
diff changeset
  1891
62183
7fdcc25c5c35 misc updates and tuning;
wenzelm
parents: 62154
diff changeset
  1892
  \<^bold>\<open>Workaround:\<close> Use suitable version of Linux desktops.
60291
4335ee20014e more on displays with very high resolution;
wenzelm
parents: 60270
diff changeset
  1893
61477
e467ae7aa808 more control symbols;
wenzelm
parents: 61458
diff changeset
  1894
  \<^item> \<^bold>\<open>Problem:\<close> Full-screen mode via jEdit action @{action_ref
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1895
  "toggle-full-screen"} (default keyboard shortcut \<^verbatim>\<open>F11\<close>) works on Windows,
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1896
  but not on Mac OS X or various Linux/X11 window managers.
54349
fd5ddf2bce76 more on problems and workarounds;
wenzelm
parents: 54348
diff changeset
  1897
61574
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1898
  \<^bold>\<open>Workaround:\<close> Use native full-screen control of the window manager (notably
e717f152d2a8 tuned whitespace;
wenzelm
parents: 61573
diff changeset
  1899
  on Mac OS X).
58618
782f0b662cae more cartouches;
wenzelm
parents: 58556
diff changeset
  1900
\<close>
53770
db362319d766 added/updated material from src/Tools/jEdit/README.html;
wenzelm
parents: 53769
diff changeset
  1901
53769
036e80175bdd basic setup for Isabelle/jEdit documentation;
wenzelm
parents:
diff changeset
  1902
end