src/Doc/JEdit/JEdit.thy
changeset 57420 8103a3f6f342
parent 57415 e721124f1b1e
child 57425 625a369b4f32
equal deleted inserted replaced
57417:29fe9bac501b 57420:8103a3f6f342
     6 
     6 
     7 chapter {* Introduction *}
     7 chapter {* Introduction *}
     8 
     8 
     9 section {* Concepts and terminology *}
     9 section {* Concepts and terminology *}
    10 
    10 
    11 text {* Isabelle/jEdit is a Prover IDE that integrates \emph{parallel
    11 text {*
    12   proof checking} \cite{Wenzel:2009,Wenzel:2013:ITP} with
    12   Isabelle/jEdit is a Prover IDE that integrates \emph{parallel proof
    13   \emph{asynchronous user interaction}
    13   checking} \cite{Wenzel:2009,Wenzel:2013:ITP} with \emph{asynchronous user
    14   \cite{Wenzel:2010,Wenzel:2012:UITP-EPTCS}, based on a
    14   interaction} \cite{Wenzel:2010,Wenzel:2012:UITP-EPTCS,Wenzel:2014:ITP-PIDE},
    15   document-oriented approach to \emph{continuous proof processing}
    15   based on a document-oriented approach to \emph{continuous proof processing}
    16   \cite{Wenzel:2011:CICM,Wenzel:2012}. Many concepts and system
    16   \cite{Wenzel:2011:CICM,Wenzel:2012}. Many concepts and system components are
    17   components are fit together in order to make this work. The main
    17   fit together in order to make this work. The main building blocks are as
    18   building blocks are as follows.
    18   follows.
    19 
    19 
    20   \begin{description}
    20   \begin{description}
    21 
    21 
    22   \item [PIDE] is a general framework for Prover IDEs based on Isabelle/Scala.
    22   \item [PIDE] is a general framework for Prover IDEs based on Isabelle/Scala.
    23   It is built around a concept of parallel and asynchronous document
    23   It is built around a concept of parallel and asynchronous document
    72   \end{figure}
    72   \end{figure}
    73 
    73 
    74   Isabelle/jEdit (\figref{fig:isabelle-jedit}) consists of some plugins for
    74   Isabelle/jEdit (\figref{fig:isabelle-jedit}) consists of some plugins for
    75   the jEdit text editor, while preserving its general look-and-feel as far as
    75   the jEdit text editor, while preserving its general look-and-feel as far as
    76   possible. The main plugin is called ``Isabelle'' and has its own menu
    76   possible. The main plugin is called ``Isabelle'' and has its own menu
    77   \emph{Plugins~/ Isabelle} with several panels (see also
    77   \emph{Plugins~/ Isabelle} with access to several panels (see also
    78   \secref{sec:dockables}), as well as \emph{Plugins~/ Plugin Options~/
    78   \secref{sec:dockables}), as well as \emph{Plugins~/ Plugin Options~/
    79   Isabelle} (see also \secref{sec:options}).
    79   Isabelle} (see also \secref{sec:options}).
    80 
    80 
    81   The options allow to specify a logic session name --- the same selector is
    81   The options allow to specify a logic session name --- the same selector is
    82   accessible in the \emph{Theories} panel (\secref{sec:theories}). On
    82   accessible in the \emph{Theories} panel (\secref{sec:theories}). On
    83   application startup, the selected logic session image is provided
    83   application startup, the selected logic session image is provided
    84   automatically by the Isabelle build tool \cite{isabelle-sys}: if it is
    84   automatically by the Isabelle build tool \cite{isabelle-sys}: if it is
    85   absent or outdated wrt.\ its sources, the build process updates it before
    85   absent or outdated wrt.\ its sources, the build process updates it before
    86   entering the Prover IDE.  Changing the logic session within Isabelle/jEdit
    86   entering the Prover IDE.  Changing the logic session within Isabelle/jEdit
    87   requires a restart of the application.
    87   requires a restart of the whole application.
    88 
    88 
    89   \medskip The main job of the Prover IDE is to manage sources and their
    89   \medskip The main job of the Prover IDE is to manage sources and their
    90   changes, taking the logical structure as a formal document into account (see
    90   changes, taking the logical structure as a formal document into account (see
    91   also \secref{sec:document-model}). The editor and the prover are connected
    91   also \secref{sec:document-model}). The editor and the prover are connected
    92   asynchronously in a lock-free manner. The prover is free to organize the
    92   asynchronously in a lock-free manner. The prover is free to organize the
    93   checking of the formal text in parallel on multiple cores, and provides
    93   checking of the formal text in parallel on multiple cores, and provides
    94   feedback via markup, which is rendered in the editor via colors, boxes,
    94   feedback via markup, which is rendered in the editor via colors, boxes,
    95   squiggly underline, hyperlinks, popup windows, icons, clickable output etc.
    95   squiggly underlines, hyperlinks, popup windows, icons, clickable output etc.
    96 
    96 
    97   Using the mouse together with the modifier key @{verbatim CONTROL} (Linux,
    97   Using the mouse together with the modifier key @{verbatim CONTROL} (Linux,
    98   Windows) or @{verbatim COMMAND} (Mac OS X) exposes additional formal content
    98   Windows) or @{verbatim COMMAND} (Mac OS X) exposes additional formal content
    99   via tooltips and/or hyperlinks (see also \secref{sec:tooltips-hyperlinks}).
    99   via tooltips and/or hyperlinks (see also \secref{sec:tooltips-hyperlinks}).
   100   Formal output (in popups etc.) may be explored recursively, using the same
   100   Output (in popups etc.) may be explored recursively, using the same
   101   techniques as in the editor source buffer.
   101   techniques as in the editor source buffer.
   102 
   102 
   103   Thus the Prover IDE gives an impression of direct access to formal content
   103   Thus the Prover IDE gives an impression of direct access to formal content
   104   of the prover within the editor, but in reality only certain aspects are
   104   of the prover within the editor, but in reality only certain aspects are
   105   exposed, according to the possibilities of the prover and its many add-on
   105   exposed, according to the possibilities of the prover and its many tools.
   106   tools.
       
   107 *}
   106 *}
   108 
   107 
   109 
   108 
   110 subsection {* Documentation *}
   109 subsection {* Documentation *}
   111 
   110 
   127 *}
   126 *}
   128 
   127 
   129 
   128 
   130 subsection {* Plugins *}
   129 subsection {* Plugins *}
   131 
   130 
   132 text {* The \emph{Plugin Manager} of jEdit allows to augment editor
   131 text {*
   133   functionality by JVM modules (jars) that are provided by the central
   132   The \emph{Plugin Manager} of jEdit allows to augment editor functionality by
   134   plugin repository, which is accessible via various mirror sites.
   133   JVM modules (jars) that are provided by the central plugin repository, which
   135 
   134   is accessible via various mirror sites.
   136   Connecting to the plugin server infrastructure of the jEdit project
   135 
   137   allows to update bundled plugins or to add further functionality.
   136   Connecting to the plugin server-infrastructure of the jEdit project allows
   138   This needs to be done with the usual care for such an open bazaar of
   137   to update bundled plugins or to add further functionality. This needs to be
   139   contributions. Arbitrary combinations of add-on features are apt to
   138   done with the usual care for such an open bazaar of contributions. Arbitrary
   140   cause problems.  It is advisable to start with the default
   139   combinations of add-on features are apt to cause problems. It is advisable
   141   configuration of Isabelle/jEdit and develop some understanding how
   140   to start with the default configuration of Isabelle/jEdit and develop some
   142   it is supposed to work, before loading additional plugins at a grand
   141   understanding how it is supposed to work, before loading additional plugins
   143   scale.
   142   at a grand scale.
   144 
   143 
   145   \medskip The main \emph{Isabelle} plugin is an integral part of
   144   \medskip The main \emph{Isabelle} plugin is an integral part of
   146   Isabelle/jEdit and needs to remain active at all times! A few additional
   145   Isabelle/jEdit and needs to remain active at all times! A few additional
   147   plugins are bundled with Isabelle/jEdit for convenience or out of necessity,
   146   plugins are bundled with Isabelle/jEdit for convenience or out of necessity,
   148   notably \emph{Console} with its Isabelle/Scala sub-plugin
   147   notably \emph{Console} with its Isabelle/Scala sub-plugin
   150   parsers for document tree structure (\secref{sec:sidekick}). The
   149   parsers for document tree structure (\secref{sec:sidekick}). The
   151   \emph{Navigator} plugin is particularly important for hyperlinks within the
   150   \emph{Navigator} plugin is particularly important for hyperlinks within the
   152   formal document-model (\secref{sec:tooltips-hyperlinks}). Further plugins
   151   formal document-model (\secref{sec:tooltips-hyperlinks}). Further plugins
   153   (e.g.\ \emph{ErrorList}, \emph{Code2HTML}) are included to saturate the
   152   (e.g.\ \emph{ErrorList}, \emph{Code2HTML}) are included to saturate the
   154   dependencies of bundled plugins, but have no particular use in
   153   dependencies of bundled plugins, but have no particular use in
   155   Isabelle/jEdit. *}
   154   Isabelle/jEdit.
       
   155 *}
   156 
   156 
   157 
   157 
   158 subsection {* Options \label{sec:options} *}
   158 subsection {* Options \label{sec:options} *}
   159 
   159 
   160 text {* Both jEdit and Isabelle have distinctive management of
   160 text {* Both jEdit and Isabelle have distinctive management of
   202 
   202 
   203   This is relevant for Isabelle/jEdit due to various fine-tuning of default
   203   This is relevant for Isabelle/jEdit due to various fine-tuning of default
   204   properties, and additional keyboard shortcuts for Isabelle-specific
   204   properties, and additional keyboard shortcuts for Isabelle-specific
   205   functionality. Users may change their keymap later, but need to copy some
   205   functionality. Users may change their keymap later, but need to copy some
   206   keyboard shortcuts manually (see also @{file_unchecked
   206   keyboard shortcuts manually (see also @{file_unchecked
   207   "$ISABELLE_HOME_USER/jedit/keymaps"}).
   207   "$ISABELLE_HOME_USER/jedit/keymaps"} versus @{verbatim shortcut} properties
   208 *}
   208   in @{file "$ISABELLE_HOME/src/Tools/jEdit/src/jEdit.props"}).
   209 
   209 *}
   210 
   210 
   211 section {* Command-line invocation *}
   211 
       
   212 section {* Command-line invocation \label{sec:command-line} *}
   212 
   213 
   213 text {*
   214 text {*
   214   Isabelle/jEdit is normally invoked as standalone application, with
   215   Isabelle/jEdit is normally invoked as standalone application, with
   215   platform-specific executable wrappers for Linux, Windows, Mac OS X.
   216   platform-specific executable wrappers for Linux, Windows, Mac OS X.
   216   Nonetheless it is occasionally useful to invoke the Prover IDE on the
   217   Nonetheless it is occasionally useful to invoke the Prover IDE on the
   242   By default, the specified image is checked and built on demand. The
   243   By default, the specified image is checked and built on demand. The
   243   @{verbatim "-s"} option determines where to store the result session image
   244   @{verbatim "-s"} option determines where to store the result session image
   244   of @{tool build}. The @{verbatim "-n"} option bypasses the implicit build
   245   of @{tool build}. The @{verbatim "-n"} option bypasses the implicit build
   245   process for the selected session image.
   246   process for the selected session image.
   246 
   247 
   247   The @{verbatim "-m"} option specifies additional print modes for the
   248   The @{verbatim "-m"} option specifies additional print modes for the prover
   248   prover process.  Note that the system option @{system_option_ref
   249   process. Note that the system option @{system_option_ref jedit_print_mode}
   249   jedit_print_mode} allows to do the same persistently (e.g.\ via the
   250   allows to do the same persistently (e.g.\ via the \emph{Plugin Options}
   250   Plugin Options dialog of Isabelle/jEdit), without requiring
   251   dialog of Isabelle/jEdit), without requiring command-line invocation.
   251   command-line invocation.
   252 
   252 
   253   The @{verbatim "-J"} and @{verbatim "-j"} options allow to pass additional
   253   The @{verbatim "-J"} and @{verbatim "-j"} options allow to pass
   254   low-level options to the JVM or jEdit, respectively. The defaults are
   254   additional low-level options to the JVM or jEdit, respectively.  The
   255   provided by the Isabelle settings environment \cite{isabelle-sys}, but note
   255   defaults are provided by the Isabelle settings environment
   256   that these only work for the command-line tool described here, and not the
   256   \cite{isabelle-sys}.
   257   regular application.
   257 
   258 
   258   The @{verbatim "-b"} and @{verbatim "-f"} options control the self-build
   259   The @{verbatim "-b"} and @{verbatim "-f"} options control the self-build
   259   mechanism of Isabelle/jEdit. This is only relevant for building from
   260   mechanism of Isabelle/jEdit. This is only relevant for building from
   260   sources, which also requires an auxiliary @{verbatim jedit_build} component
   261   sources, which also requires an auxiliary @{verbatim jedit_build} component
   261   from @{url "http://isabelle.in.tum.de/components"}. Note that official
   262   from @{url "http://isabelle.in.tum.de/components"}. The official
   262   Isabelle releases already include a pre-built version of Isabelle/jEdit.
   263   Isabelle release already includes a pre-built version of Isabelle/jEdit.
   263 *}
   264 *}
   264 
   265 
   265 
   266 
   266 chapter {* Augmented jEdit functionality *}
   267 chapter {* Augmented jEdit functionality *}
   267 
   268 
   271   support ``native'' look-and-feel on all platforms, within the limits
   272   support ``native'' look-and-feel on all platforms, within the limits
   272   of what Oracle as Java provider and major operating system
   273   of what Oracle as Java provider and major operating system
   273   distributors allow (see also \secref{sec:problems}).
   274   distributors allow (see also \secref{sec:problems}).
   274 
   275 
   275   Isabelle/jEdit enables platform-specific look-and-feel by default as
   276   Isabelle/jEdit enables platform-specific look-and-feel by default as
   276   follows:
   277   follows.
   277 
   278 
   278   \begin{description}
   279   \begin{description}
   279 
   280 
   280   \item[Linux] The platform-independent \emph{Nimbus} is used by
   281   \item[Linux:] The platform-independent \emph{Nimbus} is used by
   281   default.
   282   default.
   282 
   283 
   283   \emph{GTK+} works under the side-condition that the overall GTK theme is
   284   \emph{GTK+} works under the side-condition that the overall GTK theme is
   284   selected in a Swing-friendly way.\footnote{GTK support in Java/Swing was
   285   selected in a Swing-friendly way.\footnote{GTK support in Java/Swing was
   285   once marketed aggressively by Sun, but never quite finished. Today (2013) it
   286   once marketed aggressively by Sun, but never quite finished. Today (2013) it
   286   is lagging behind further development of Swing and GTK. The graphics
   287   is lagging behind further development of Swing and GTK. The graphics
   287   rendering performance can be worse than for other Swing look-and-feels.}
   288   rendering performance can be worse than for other Swing look-and-feels.}
   288 
   289 
   289   \item[Windows] Regular \emph{Windows} is used by default, but
   290   \item[Windows:] Regular \emph{Windows} is used by default, but
   290   \emph{Windows Classic} also works.
   291   \emph{Windows Classic} also works.
   291 
   292 
   292   \item[Mac OS X] Regular \emph{Mac OS X} is used by default.
   293   \item[Mac OS X:] Regular \emph{Mac OS X} is used by default.
   293 
   294 
   294   Moreover the bundled \emph{MacOSX} plugin provides various functions that
   295   The bundled \emph{MacOSX} plugin provides various functions that are
   295   are expected from applications on that particular platform: quit from menu
   296   expected from applications on that particular platform: quit from menu or
   296   or dock, preferences menu, drag-and-drop of text files on the application,
   297   dock, preferences menu, drag-and-drop of text files on the application,
   297   full-screen mode for main editor windows. It is advisable to have the
   298   full-screen mode for main editor windows. It is advisable to have the
   298   \emph{MacOSX} enabled all the time on that platform.
   299   \emph{MacOSX} plugin enabled all the time on that platform.
   299 
   300 
   300   \end{description}
   301   \end{description}
   301 
   302 
   302   Users may experiment with different look-and-feels, but need to keep
   303   Users may experiment with different look-and-feels, but need to keep
   303   in mind that this extra variance of GUI functionality is unlikely to
   304   in mind that this extra variance of GUI functionality is unlikely to
   326 
   327 
   327   Dockables are used routinely in jEdit for important functionality like
   328   Dockables are used routinely in jEdit for important functionality like
   328   \emph{HyperSearch Results} or the \emph{File System Browser}. Plugins often
   329   \emph{HyperSearch Results} or the \emph{File System Browser}. Plugins often
   329   provide a central dockable to access their key functionality, which may be
   330   provide a central dockable to access their key functionality, which may be
   330   opened by the user on demand. The Isabelle/jEdit plugin takes this approach
   331   opened by the user on demand. The Isabelle/jEdit plugin takes this approach
   331   to the extreme: its main plugin menu merely provides entry-points to panels
   332   to the extreme: its plugin menu merely provides entry-points to panels that
   332   that are managed as dockable windows. Some important panels are docked by
   333   are managed as dockable windows. Some important panels are docked by
   333   default, e.g.\ \emph{Documentation}, \emph{Output}, \emph{Query}, but the
   334   default, e.g.\ \emph{Documentation}, \emph{Output}, \emph{Query}, but the
   334   user can change this arrangement easily.
   335   user can change this arrangement easily.
   335 
   336 
   336   Compared to plain jEdit, dockable window management in Isabelle/jEdit is
   337   Compared to plain jEdit, dockable window management in Isabelle/jEdit is
   337   slightly augmented according to the the following principles:
   338   slightly augmented according to the the following principles:
   363 *}
   364 *}
   364 
   365 
   365 
   366 
   366 section {* Isabelle symbols \label{sec:symbols} *}
   367 section {* Isabelle symbols \label{sec:symbols} *}
   367 
   368 
   368 text {* Isabelle sources consist of \emph{symbols} that extend plain
   369 text {*
   369   ASCII to allow infinitely many mathematical symbols within the
   370   Isabelle sources consist of \emph{symbols} that extend plain ASCII to allow
   370   formal sources.  This works without depending on particular
   371   infinitely many mathematical symbols within the formal sources. This works
   371   encodings and varying Unicode standards
   372   without depending on particular encodings and varying Unicode
   372   \cite{Wenzel:2011:CICM}.\footnote{Raw Unicode characters within
   373   standards.\footnote{Raw Unicode characters within formal sources would
   373   formal sources would compromise portability and reliability in the
   374   compromise portability and reliability in the face of changing
   374   face of changing interpretation of special features of Unicode, such
   375   interpretation of special features of Unicode, such as Combining Characters
   375   as Combining Characters or Bi-directional Text.}
   376   or Bi-directional Text.} See also \cite{Wenzel:2011:CICM}.
   376 
   377 
   377   For the prover back-end, formal text consists of ASCII characters
   378   For the prover back-end, formal text consists of ASCII characters that are
   378   that are grouped according to some simple rules, e.g.\ as plain
   379   grouped according to some simple rules, e.g.\ as plain ``@{verbatim a}'' or
   379   ``@{verbatim a}'' or symbolic ``@{verbatim "\<alpha>"}''.
   380   symbolic ``@{verbatim "\<alpha>"}''. For the editor front-end, a certain subset of
   380 
   381   symbols is rendered physically via Unicode glyphs, in order to show
   381   For the editor front-end, a certain subset of symbols is rendered
   382   ``@{verbatim "\<alpha>"}'' as ``@{text "\<alpha>"}'', for example. This symbol
   382   physically via Unicode glyphs, in order to show ``@{verbatim "\<alpha>"}''
   383   interpretation is specified by the Isabelle system distribution in @{file
   383   as ``@{text "\<alpha>"}'', for example.  This symbol interpretation is
       
   384   specified by the Isabelle system distribution in @{file
       
   385   "$ISABELLE_HOME/etc/symbols"} and may be augmented by the user in
   384   "$ISABELLE_HOME/etc/symbols"} and may be augmented by the user in
   386   @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"}.
   385   @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"}.
   387 
   386 
   388   The appendix of \cite{isabelle-isar-ref} gives an overview of the
   387   The appendix of \cite{isabelle-isar-ref} gives an overview of the
   389   standard interpretation of finitely many symbols from the infinite
   388   standard interpretation of finitely many symbols from the infinite
   390   collection.  Uninterpreted symbols are displayed literally, e.g.\
   389   collection.  Uninterpreted symbols are displayed literally, e.g.\
   391   ``@{verbatim "\<foobar>"}''.  Overlap of Unicode characters used in
   390   ``@{verbatim "\<foobar>"}''.  Overlap of Unicode characters used in
   392   symbol interpretation with informal ones (which might appear e.g.\
   391   symbol interpretation with informal ones (which might appear e.g.\
   393   in comments) needs to be avoided!  Raw Unicode characters within
   392   in comments) needs to be avoided.  Raw Unicode characters within
   394   prover source files should be restricted to informal parts, e.g.\ to
   393   prover source files should be restricted to informal parts, e.g.\ to
   395   write text in non-latin alphabets in comments.
   394   write text in non-latin alphabets in comments.
   396 
   395 
   397   \medskip \paragraph{Encoding.} Technically, the Unicode view on
   396   \medskip \paragraph{Encoding.} Technically, the Unicode view on Isabelle
   398   Isabelle symbols is an \emph{encoding} in jEdit (not in the
   397   symbols is an \emph{encoding} in jEdit (not in the underlying JVM) that is
   399   underlying JVM) that is called @{verbatim "UTF-8-Isabelle"}.  It is
   398   called @{verbatim "UTF-8-Isabelle"}. It is provided by the Isabelle/jEdit
   400   provided by the Isabelle/jEdit plugin and enabled by default for all
   399   plugin and enabled by default for all source files. Sometimes such defaults
   401   source files.  Sometimes such defaults are reset accidentally, or
   400   are reset accidentally, or malformed UTF-8 sequences in the text force jEdit
   402   malformed UTF-8 sequences in the text force jEdit to fall back on a
   401   to fall back on a different encoding like @{verbatim "ISO-8859-15"}. In that
   403   different encoding like @{verbatim "ISO-8859-15"}.  In that case,
   402   case, verbatim ``@{verbatim "\<alpha>"}'' will be shown in the text buffer instead
   404   verbatim ``@{verbatim "\<alpha>"}'' will be shown in the text buffer
   403   of its Unicode rendering ``@{text "\<alpha>"}''. The jEdit menu operation
   405   instead of its Unicode rendering ``@{text "\<alpha>"}''.  The jEdit menu
   404   \emph{File~/ Reload with Encoding~/ UTF-8-Isabelle} helps to resolve such
   406   operation \emph{File~/ Reload with Encoding~/ UTF-8-Isabelle} helps
   405   problems (after repairing malformed parts of the text).
   407   to resolve such problems, potentially after repairing malformed
       
   408   parts of the text.
       
   409 
   406 
   410   \medskip \paragraph{Font.} Correct rendering via Unicode requires a
   407   \medskip \paragraph{Font.} Correct rendering via Unicode requires a
   411   font that contains glyphs for the corresponding codepoints.  Most
   408   font that contains glyphs for the corresponding codepoints.  Most
   412   system fonts lack that, so Isabelle/jEdit prefers its own
   409   system fonts lack that, so Isabelle/jEdit prefers its own
   413   application font @{verbatim IsabelleText}, which ensures that
   410   application font @{verbatim IsabelleText}, which ensures that
   414   standard collection of Isabelle symbols are actually seen on the
   411   standard collection of Isabelle symbols are actually seen on the
   415   screen (or printer).
   412   screen (or printer).
   416 
   413 
   417   Note that a Java/AWT/Swing application can load additional fonts
   414   Note that a Java/AWT/Swing application can load additional fonts only if
   418   only if they are not installed on the operating system already!
   415   they are not installed on the operating system already! Some outdated
   419   Some old version of @{verbatim IsabelleText} that happens to be
   416   version of @{verbatim IsabelleText} that happens to be provided by the
   420   provided by the operating system would prevent Isabelle/jEdit to use
   417   operating system would prevent Isabelle/jEdit to use its bundled version.
   421   its bundled version.  This could lead to missing glyphs (black
   418   This could lead to missing glyphs (black rectangles), when the system
   422   rectangles), when the system version of @{verbatim IsabelleText} is
   419   version of @{verbatim IsabelleText} is older than the application version.
   423   older than the application version.  This problem can be avoided by
   420   This problem can be avoided by refraining to ``install'' any version of
   424   refraining to ``install'' any version of @{verbatim IsabelleText} in
   421   @{verbatim IsabelleText} in the first place, although it is occasionally
   425   the first place (although it is occasionally tempting to use
   422   tempting to use the same font in other applications.
   426   the same font in other applications).
       
   427 
   423 
   428   \medskip \paragraph{Input methods.} In principle, Isabelle/jEdit
   424   \medskip \paragraph{Input methods.} In principle, Isabelle/jEdit
   429   could delegate the problem to produce Isabelle symbols in their
   425   could delegate the problem to produce Isabelle symbols in their
   430   Unicode rendering to the underlying operating system and its
   426   Unicode rendering to the underlying operating system and its
   431   \emph{input methods}.  Regular jEdit also provides various ways to
   427   \emph{input methods}.  Regular jEdit also provides various ways to
   432   work with \emph{abbreviations} to produce certain non-ASCII
   428   work with \emph{abbreviations} to produce certain non-ASCII
   433   characters.  Since none of these standard input methods work
   429   characters.  Since none of these standard input methods work
   434   satisfactorily for the mathematical characters required for
   430   satisfactorily for the mathematical characters required for
   435   Isabelle, various specific Isabelle/jEdit mechanisms are provided.
   431   Isabelle, various specific Isabelle/jEdit mechanisms are provided.
   436 
   432 
   437   Here is a summary for practically relevant input methods for
   433   This is a summary for practically relevant input methods for Isabelle
   438   Isabelle symbols:
   434   symbols.
   439 
   435 
   440   \begin{enumerate}
   436   \begin{enumerate}
   441 
   437 
   442   \item The \emph{Symbols} panel: some GUI buttons allow to insert
   438   \item The \emph{Symbols} panel: some GUI buttons allow to insert
   443   certain symbols in the text buffer.  There are also tooltips to
   439   certain symbols in the text buffer.  There are also tooltips to
   485     @{text "\<in>"} & @{verbatim "\\in"} & @{verbatim ":"} \\
   481     @{text "\<in>"} & @{verbatim "\\in"} & @{verbatim ":"} \\
   486     @{text "\<notin>"} & @{verbatim "\\notin"} & @{verbatim "~:"} \\
   482     @{text "\<notin>"} & @{verbatim "\\notin"} & @{verbatim "~:"} \\
   487   \end{tabular}
   483   \end{tabular}
   488   \medskip
   484   \medskip
   489 
   485 
   490   Note that the above abbreviations refer to the input method. The
   486   Note that the above abbreviations refer to the input method. The logical
   491   logical notation provides ASCII alternatives that often coincide,
   487   notation provides ASCII alternatives that often coincide, but sometimes
   492   but deviate occasionally.  This occasionally causes user confusion
   488   deviate. This occasionally causes user confusion with very old-fashioned
   493   with very old-fashioned Isabelle source that use ASCII replacement
   489   Isabelle source that use ASCII replacement notation like @{verbatim "!"} or
   494   notation like @{verbatim "!"} or @{verbatim "ALL"} directly in the
   490   @{verbatim "ALL"} directly in the text.
   495   text.
       
   496 
   491 
   497   On the other hand, coincidence of symbol abbreviations with ASCII
   492   On the other hand, coincidence of symbol abbreviations with ASCII
   498   replacement syntax syntax helps to update old theory sources via
   493   replacement syntax syntax helps to update old theory sources via
   499   explicit completion (see also @{verbatim "C+b"} explained in
   494   explicit completion (see also @{verbatim "C+b"} explained in
   500   \secref{sec:completion}).
   495   \secref{sec:completion}).
   560   the cross-platform \emph{System} shell. Thus the console provides similar
   555   the cross-platform \emph{System} shell. Thus the console provides similar
   561   functionality than the special Emacs buffers @{verbatim "*scratch*"} and
   556   functionality than the special Emacs buffers @{verbatim "*scratch*"} and
   562   @{verbatim "*shell*"}.
   557   @{verbatim "*shell*"}.
   563 
   558 
   564   Isabelle/jEdit extends the repertoire of the console by \emph{Scala}, which
   559   Isabelle/jEdit extends the repertoire of the console by \emph{Scala}, which
   565   is the regular Scala toplevel loop running inside the \emph{same} JVM
   560   is the regular Scala toplevel loop running inside the same JVM process as
   566   process as Isabelle/jEdit itself. This means the Scala command interpreter
   561   Isabelle/jEdit itself. This means the Scala command interpreter has access
   567   has access to the JVM name space and state of the running Prover IDE
   562   to the JVM name space and state of the running Prover IDE application: the
   568   application: the main entry points are @{verbatim view} (the current editor
   563   main entry points are @{verbatim view} (the current editor view of jEdit)
   569   view of jEdit) and @{verbatim PIDE} (the Isabelle/jEdit plugin object). For
   564   and @{verbatim PIDE} (the Isabelle/jEdit plugin object). For example, the
   570   example, the Scala expression @{verbatim "PIDE.snapshot(view)"} makes a PIDE
   565   Scala expression @{verbatim "PIDE.snapshot(view)"} makes a PIDE document
   571   document snapshot of the current buffer within the current editor view.
   566   snapshot of the current buffer within the current editor view.
   572 
   567 
   573   This helps to explore Isabelle/Scala functionality interactively. Some care
   568   This helps to explore Isabelle/Scala functionality interactively. Some care
   574   is required to avoid interference with the internals of the running
   569   is required to avoid interference with the internals of the running
   575   application, especially in production use.
   570   application, especially in production use.
   576 *}
   571 *}
   577 
   572 
   578 
   573 
   579 section {* File-system access *}
   574 section {* File-system access *}
   580 
   575 
   581 text {* File specifications in jEdit follow various formats and
   576 text {*
   582   conventions according to \emph{Virtual File Systems}, which may be
   577   File specifications in jEdit follow various formats and conventions
   583   also provided by additional plugins.  This allows to access remote
   578   according to \emph{Virtual File Systems}, which may be also provided by
   584   files via the @{verbatim "http:"} protocol prefix, for example.
   579   additional plugins. This allows to access remote files via the @{verbatim
   585   Isabelle/jEdit attempts to work with the file-system access model of
   580   "http:"} protocol prefix, for example. Isabelle/jEdit attempts to work with
   586   jEdit as far as possible.  In particular, theory sources are passed
   581   the file-system model of jEdit as far as possible. In particular, theory
   587   directly from the editor to the prover, without indirection via
   582   sources are passed directly from the editor to the prover, without
   588   physical files.
   583   indirection via physical files.
   589 
   584 
   590   Despite the flexibility of URLs in jEdit, local files are
   585   Despite the flexibility of URLs in jEdit, local files are particularly
   591   particularly important and are accessible without protocol prefix.
   586   important and are accessible without protocol prefix. Here the path notation
   592   Here the path notation is that of the Java Virtual Machine on the
   587   is that of the Java Virtual Machine on the underlying platform. On Windows
   593   underlying platform.  On Windows the preferred form uses
   588   the preferred form uses backslashes, but happens to accept forward slashes
   594   backslashes, but happens to accept forward slashes of Unix/POSIX, too.
   589   like Unix/POSIX. Further differences arise due to Windows drive letters and
   595   Further differences arise due to drive letters and network shares.
   590   network shares.
   596 
   591 
   597   The Java notation for files needs to be distinguished from the one of
   592   The Java notation for files needs to be distinguished from the one of
   598   Isabelle, which uses POSIX notation with forward slashes on \emph{all}
   593   Isabelle, which uses POSIX notation with forward slashes on \emph{all}
   599   platforms.\footnote{Isabelle/ML on Windows uses Cygwin file-system access
   594   platforms.\footnote{Isabelle/ML on Windows uses Cygwin file-system access
   600   and Unix-style path notation.} Moreover, environment variables from the
   595   and Unix-style path notation.} Moreover, environment variables from the
   601   Isabelle process may be used freely, e.g.\ @{file
   596   Isabelle process may be used freely, e.g.\ @{file
   602   "$ISABELLE_HOME/etc/symbols"} or @{file_unchecked "$POLYML_HOME/README"}.
   597   "$ISABELLE_HOME/etc/symbols"} or @{file_unchecked "$POLYML_HOME/README"}.
   603   There are special shortcuts: @{file "~"} for @{file "$USER_HOME"} and @{file
   598   There are special shortcuts: @{file "~"} for @{file "$USER_HOME"} and @{file
   604   "~~"} for @{file "$ISABELLE_HOME"}.
   599   "~~"} for @{file "$ISABELLE_HOME"}.
   605 
   600 
   606   \medskip Since jEdit happens to support environment variables within
   601   \medskip Since jEdit happens to support environment variables within file
   607   file specifications as well, it is natural to use similar notation
   602   specifications as well, it is natural to use similar notation within the
   608   within the editor, e.g.\ in the file-browser.  This does not work in
   603   editor, e.g.\ in the file-browser. This does not work in full generality,
   609   full generality, though, due to the bias of jEdit towards
   604   though, due to the bias of jEdit towards platform-specific notation and of
   610   platform-specific notation and of Isabelle towards POSIX.  Moreover,
   605   Isabelle towards POSIX. Moreover, the Isabelle settings environment is not
   611   the Isabelle settings environment is not yet active when starting
   606   yet active when starting Isabelle/jEdit via its standard application
   612   Isabelle/jEdit via its standard application wrapper (in contrast to
   607   wrapper, in contrast to @{verbatim "isabelle jedit"} run from the command
   613   @{verbatim "isabelle jedit"} run from the command line).
   608   line (\secref{sec:command-line}).
   614 
   609 
   615   Isabelle/jEdit imitates @{verbatim "$ISABELLE_HOME"} and @{verbatim
   610   Isabelle/jEdit imitates @{verbatim "$ISABELLE_HOME"} and @{verbatim
   616   "$ISABELLE_HOME_USER"} within the Java process environment, in order to
   611   "$ISABELLE_HOME_USER"} within the Java process environment, in order to
   617   allow easy access to these important places from the editor. The file
   612   allow easy access to these important places from the editor. The file
   618   browser of jEdit also includes \emph{Favorites} for these two important
   613   browser of jEdit also includes \emph{Favorites} for these two important
   622   formal markup that turns it into a hyperlink (see also
   617   formal markup that turns it into a hyperlink (see also
   623   \secref{sec:tooltips-hyperlinks}). This allows to open the corresponding
   618   \secref{sec:tooltips-hyperlinks}). This allows to open the corresponding
   624   file in the text editor, independently of the path notation.
   619   file in the text editor, independently of the path notation.
   625 
   620 
   626   Formally checked paths in prover input are subject to completion
   621   Formally checked paths in prover input are subject to completion
   627   (\secref{sec:completion}): partial specifications are resolved via actual
   622   (\secref{sec:completion}): partial specifications are resolved via
   628   directory content and possible completions are offered in a popup.
   623   directory content and possible completions are offered in a popup.
   629 *}
   624 *}
   630 
   625 
   631 
   626 
   632 chapter {* Prover IDE functionality \label{sec:document-model} *}
   627 chapter {* Prover IDE functionality \label{sec:document-model} *}
   708 
   703 
   709   Certain events to open or update editor buffers cause Isabelle/jEdit to
   704   Certain events to open or update editor buffers cause Isabelle/jEdit to
   710   resolve dependencies of theory imports. The system requests to load
   705   resolve dependencies of theory imports. The system requests to load
   711   additional files into editor buffers, in order to be included in the
   706   additional files into editor buffers, in order to be included in the
   712   document model for further checking. It is also possible to let the system
   707   document model for further checking. It is also possible to let the system
   713   resolve dependencies automatically, according to \emph{Plugin Options~/
   708   resolve dependencies automatically, according to the system option
   714   Isabelle~/ General~/ Auto Load}.
   709   @{system_option jedit_auto_load}.
   715 
   710 
   716   \medskip The visible \emph{perspective} of Isabelle/jEdit is defined by the
   711   \medskip The visible \emph{perspective} of Isabelle/jEdit is defined by the
   717   collective view on theory buffers via open text areas. The perspective is
   712   collective view on theory buffers via open text areas. The perspective is
   718   taken as a hint for document processing: the prover ensures that those parts
   713   taken as a hint for document processing: the prover ensures that those parts
   719   of a theory where the user is looking are checked, while other parts that
   714   of a theory where the user is looking are checked, while other parts that
   730   marked as required can have significant impact on performance,
   725   marked as required can have significant impact on performance,
   731   though.
   726   though.
   732 
   727 
   733   \medskip Formal markup of checked theory content is turned into GUI
   728   \medskip Formal markup of checked theory content is turned into GUI
   734   rendering, based on a standard repertoire known from IDEs for programming
   729   rendering, based on a standard repertoire known from IDEs for programming
   735   languages: colors, icons, highlighting, squiggly underline, tooltips,
   730   languages: colors, icons, highlighting, squiggly underlines, tooltips,
   736   hyperlinks etc. For outer syntax of Isabelle/Isar there is some traditional
   731   hyperlinks etc. For outer syntax of Isabelle/Isar there is some traditional
   737   syntax-highlighting via static keyword tables and tokenization within the
   732   syntax-highlighting via static keyword tables and tokenization within the
   738   editor. In contrast, the painting of inner syntax (term language etc.)\ uses
   733   editor. In contrast, the painting of inner syntax (term language etc.)\ uses
   739   semantic information that is reported dynamically from the logical context.
   734   semantic information that is reported dynamically from the logical context.
   740   Thus the prover can provide additional markup to help the user to understand
   735   Thus the prover can provide additional markup to help the user to understand
   757   treated as changes of the corresponding load command.
   752   treated as changes of the corresponding load command.
   758 
   753 
   759   \medskip As a concession to the massive amount of ML files in Isabelle/HOL
   754   \medskip As a concession to the massive amount of ML files in Isabelle/HOL
   760   itself, the content of auxiliary files is only added to the PIDE
   755   itself, the content of auxiliary files is only added to the PIDE
   761   document-model on demand, the first time when opened explicitly in the
   756   document-model on demand, the first time when opened explicitly in the
   762   editor. There are further special tricks to manage markup of ML files, such
   757   editor. There are further tricks to manage markup of ML files, such that
   763   that Isabelle/HOL may be edited conveniently in the Prover IDE on small
   758   Isabelle/HOL may be edited conveniently in the Prover IDE on small machines
   764   machines with only 4--8\,GB of main memory. Using @{verbatim Pure} as logic
   759   with only 4--8\,GB of main memory. Using @{verbatim Pure} as logic session
   765   session image, the exploration may start at the top @{file
   760   image, the exploration may start at the top @{file
   766   "$ISABELLE_HOME/src/HOL/Main.thy"} or the bottom @{file
   761   "$ISABELLE_HOME/src/HOL/Main.thy"} or the bottom @{file
   767   "$ISABELLE_HOME/src/HOL/HOL.thy"}, for example.
   762   "$ISABELLE_HOME/src/HOL/HOL.thy"}, for example.
   768 
   763 
   769   Initially, before an auxiliary file is opened in the editor, the prover
   764   Initially, before an auxiliary file is opened in the editor, the prover
   770   reads its content from the physical file-system. After the file is opened
   765   reads its content from the physical file-system. After the file is opened
   772   (\secref{sec:tooltips-hyperlinks}) for the argument of its @{command
   767   (\secref{sec:tooltips-hyperlinks}) for the argument of its @{command
   773   ML_file} command, the content is taken from the jEdit buffer.
   768   ML_file} command, the content is taken from the jEdit buffer.
   774 
   769 
   775   The change of responsibility from prover to editor counts as an update of
   770   The change of responsibility from prover to editor counts as an update of
   776   the document content, so subsequent theory sources need to be re-checked.
   771   the document content, so subsequent theory sources need to be re-checked.
   777   When the buffer is closed, the responsibility remains to the editor, though:
   772   When the buffer is closed, the responsibility remains to the editor: the
   778   the file may be opened again without causing another document update.
   773   file may be opened again without causing another document update.
   779 
   774 
   780   A file that is opened in the editor, but its theory with the load command is
   775   A file that is opened in the editor, but its theory with the load command is
   781   not, is presently inactive in the document model. A file that is loaded via
   776   not, is presently inactive in the document model. A file that is loaded via
   782   multiple load commands is associated to an arbitrary one: this situation is
   777   multiple load commands is associated to an arbitrary one: this situation is
   783   morally unsupported and might lead to confusion.
   778   morally unsupported and might lead to confusion.
   796 *}
   791 *}
   797 
   792 
   798 
   793 
   799 section {* Output \label{sec:output} *}
   794 section {* Output \label{sec:output} *}
   800 
   795 
   801 text {* Prover output consists of \emph{markup} and \emph{messages}.
   796 text {*
   802   Both are directly attached to the corresponding positions in the
   797   Prover output consists of \emph{markup} and \emph{messages}. Both are
   803   original source text, and visualized in the text area, e.g.\ as text
   798   directly attached to the corresponding positions in the original source
   804   colours for free and bound variables, or as squiggly underline for
   799   text, and visualized in the text area, e.g.\ as text colours for free and
   805   warnings, errors etc.\ (see also \figref{fig:output}).  In the
   800   bound variables, or as squiggly underlines for warnings, errors etc.\ (see
   806   latter case, the corresponding messages are shown by hovering with
   801   also \figref{fig:output}). In the latter case, the corresponding messages
   807   the mouse over the highlighted text --- although in many situations
   802   are shown by hovering with the mouse over the highlighted text --- although
   808   the user should already get some clue by looking at the position of
   803   in many situations the user should already get some clue by looking at the
   809   the text highlighting.
   804   position of the text highlighting, without the text itself.
   810 
   805 
   811   \begin{figure}[htb]
   806   \begin{figure}[htb]
   812   \begin{center}
   807   \begin{center}
   813   \includegraphics[scale=0.333]{output}
   808   \includegraphics[scale=0.333]{output}
   814   \end{center}
   809   \end{center}
   827   information to paint small rectangles for the overall status of the whole
   822   information to paint small rectangles for the overall status of the whole
   828   text buffer. The graphics is scaled to fit the logical buffer length into
   823   text buffer. The graphics is scaled to fit the logical buffer length into
   829   the given window height. Mouse clicks on the overview area position the
   824   the given window height. Mouse clicks on the overview area position the
   830   cursor approximately to the corresponding line of text in the buffer.
   825   cursor approximately to the corresponding line of text in the buffer.
   831   Repainting the overview in real-time causes problems with big theories, so
   826   Repainting the overview in real-time causes problems with big theories, so
   832   it is restricted according to \emph{Plugin Options~/ Isabelle~/ General~/
   827   it is restricted according to the system option @{system_option
   833   Text Overview Limit} (in characters).
   828   jedit_text_overview_limit} (in characters).
   834 
   829 
   835   Another course-grained overview is provided by the \emph{Theories}
   830   Another course-grained overview is provided by the \emph{Theories}
   836   panel, but without direct correspondence to text positions.  A
   831   panel, but without direct correspondence to text positions.  A
   837   double-click on one of the theory entries with their status overview
   832   double-click on one of the theory entries with their status overview
   838   opens the corresponding text buffer, without changing the cursor
   833   opens the corresponding text buffer, without changing the cursor
   851   Manager of jEdit can handle conveniently.
   846   Manager of jEdit can handle conveniently.
   852 
   847 
   853   Former users of the old TTY interaction model (e.g.\ Proof~General) might
   848   Former users of the old TTY interaction model (e.g.\ Proof~General) might
   854   find a separate window for prover messages familiar, but it is important to
   849   find a separate window for prover messages familiar, but it is important to
   855   understand that the main Prover IDE feedback happens elsewhere. It is
   850   understand that the main Prover IDE feedback happens elsewhere. It is
   856   possible to do meaningful proof editing, while using secondary output
   851   possible to do meaningful proof editing within the primary text area and its
   857   windows only rarely.
   852   markup, while using secondary output windows only rarely.
   858 
   853 
   859   The main purpose of the output window is to ``debug'' unclear
   854   The main purpose of the output window is to ``debug'' unclear
   860   situations by inspecting internal state of the prover.\footnote{In
   855   situations by inspecting internal state of the prover.\footnote{In
   861   that sense, unstructured tactic scripts depend on continuous
   856   that sense, unstructured tactic scripts depend on continuous
   862   debugging with internal state inspection.} Consequently, some
   857   debugging with internal state inspection.} Consequently, some
   872 
   867 
   873 section {* Query \label{sec:query} *}
   868 section {* Query \label{sec:query} *}
   874 
   869 
   875 text {*
   870 text {*
   876   The \emph{Query} panel provides various GUI forms to request extra
   871   The \emph{Query} panel provides various GUI forms to request extra
   877   information from the prover In old times the user would have issued some
   872   information from the prover. In old times the user would have issued some
   878   diagnostic command like @{command find_theorems} and inspected its output,
   873   diagnostic command like @{command find_theorems} and inspected its output,
   879   but this is now integrated into the Prover IDE.
   874   but this is now integrated into the Prover IDE.
   880 
   875 
   881   A \emph{Query} window provides some input fields and buttons for a
   876   A \emph{Query} window provides some input fields and buttons for a
   882   particular query command, with output in a dedicated text area. There are
   877   particular query command, with output in a dedicated text area. There are
   903   \item The \emph{Apply} button attaches a fresh query invocation to the
   898   \item The \emph{Apply} button attaches a fresh query invocation to the
   904   current context of the command where the cursor is pointing in the text.
   899   current context of the command where the cursor is pointing in the text.
   905 
   900 
   906   \item The \emph{Search} field allows to highlight query output according to
   901   \item The \emph{Search} field allows to highlight query output according to
   907   some regular expression, in the notation that is commonly used on the Java
   902   some regular expression, in the notation that is commonly used on the Java
   908   platform. This may serve as an additional visual filter of the result.
   903   platform.\footnote{@{url
       
   904   "http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html"}}
       
   905   This may serve as an additional visual filter of the result.
   909 
   906 
   910   \item The \emph{Zoom} box controls the font size of the output area.
   907   \item The \emph{Zoom} box controls the font size of the output area.
   911 
   908 
   912   \end{itemize}
   909   \end{itemize}
   913 
   910 
   959 text {*
   956 text {*
   960   The \emph{Query} panel in \emph{Print Context} mode prints information from
   957   The \emph{Query} panel in \emph{Print Context} mode prints information from
   961   the theory or proof context, or proof state. See also the Isar commands
   958   the theory or proof context, or proof state. See also the Isar commands
   962   @{command_ref print_context}, @{command_ref print_cases}, @{command_ref
   959   @{command_ref print_context}, @{command_ref print_cases}, @{command_ref
   963   print_term_bindings}, @{command_ref print_theorems},
   960   print_term_bindings}, @{command_ref print_theorems},
   964   @{command_ref print_state} in \cite{isabelle-isar-ref}.
   961   @{command_ref print_state} described in \cite{isabelle-isar-ref}.
   965 *}
   962 *}
   966 
   963 
   967 
   964 
   968 section {* Tooltips and hyperlinks \label{sec:tooltips-hyperlinks} *}
   965 section {* Tooltips and hyperlinks \label{sec:tooltips-hyperlinks} *}
   969 
   966 
  1101   which is occasionally useful to avoid confusion, e.g.\ the rare keyword
  1098   which is occasionally useful to avoid confusion, e.g.\ the rare keyword
  1102   @{command simproc_setup} vs.\ the frequent name-space entry @{text simp}.
  1099   @{command simproc_setup} vs.\ the frequent name-space entry @{text simp}.
  1103 *}
  1100 *}
  1104 
  1101 
  1105 
  1102 
  1106 subsubsection {* Symbols *}
  1103 subsubsection {* Isabelle symbols *}
  1107 
  1104 
  1108 text {*
  1105 text {*
  1109   The completion tables for Isabelle symbols (\secref{sec:symbols}) are
  1106   The completion tables for Isabelle symbols (\secref{sec:symbols}) are
  1110   determined statically from @{file "$ISABELLE_HOME/etc/symbols"} and
  1107   determined statically from @{file "$ISABELLE_HOME/etc/symbols"} and
  1111   @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"} for each symbol
  1108   @{file_unchecked "$ISABELLE_HOME_USER/etc/symbols"} for each symbol
  1286 subsection {* Completion popup \label{sec:completion-popup} *}
  1283 subsection {* Completion popup \label{sec:completion-popup} *}
  1287 
  1284 
  1288 text {*
  1285 text {*
  1289   A \emph{completion popup} is a minimally invasive GUI component over the
  1286   A \emph{completion popup} is a minimally invasive GUI component over the
  1290   text area that offers a selection of completion items to be inserted into
  1287   text area that offers a selection of completion items to be inserted into
  1291   the text, e.g.\ by mouse clicks. The popup interprets special keys
  1288   the text, e.g.\ by mouse clicks. Items are sorted dynamically, according to
  1292   @{verbatim TAB}, @{verbatim ESCAPE}, @{verbatim UP}, @{verbatim DOWN},
  1289   the frequency of selection, with persistent history. The popup interprets
  1293   @{verbatim PAGE_UP}, @{verbatim PAGE_DOWN}, but all other key events are
  1290   special keys @{verbatim TAB}, @{verbatim ESCAPE}, @{verbatim UP}, @{verbatim
  1294   passed to the underlying text area. This allows to ignore unwanted
  1291   DOWN}, @{verbatim PAGE_UP}, @{verbatim PAGE_DOWN}, but all other key events
       
  1292   are passed to the underlying text area. This allows to ignore unwanted
  1295   completions most of the time and continue typing quickly. Thus the popup
  1293   completions most of the time and continue typing quickly. Thus the popup
  1296   serves as a mechanism of confirmation of proposed items, but the default is
  1294   serves as a mechanism of confirmation of proposed items, but the default is
  1297   to continue without completion.
  1295   to continue without completion.
  1298 
  1296 
  1299   The meaning of special keys is as follows:
  1297   The meaning of special keys is as follows:
  1320 
  1318 
  1321 text {*
  1319 text {*
  1322   Completion may first propose replacements to be selected (via a popup), or
  1320   Completion may first propose replacements to be selected (via a popup), or
  1323   replace text immediately in certain situations and depending on certain
  1321   replace text immediately in certain situations and depending on certain
  1324   options like @{system_option jedit_completion_immediate}. In any case,
  1322   options like @{system_option jedit_completion_immediate}. In any case,
  1325   insertion works uniformly, by imitating normal text insertion to some
  1323   insertion works uniformly, by imitating normal jEdit text insertion,
  1326   extent. The precise behaviour depends on the state of the \emph{text
  1324   depending on the state of the \emph{text selection}. Isabelle/jEdit tries to
  1327   selection} of jEdit. Isabelle/jEdit tries to accommodate the most common
  1325   accommodate the most common forms of advanced selections in jEdit, but not
  1328   forms of advanced selections in jEdit, but not all combinations make sense.
  1326   all combinations make sense. At least the following important cases are
  1329   At least the following important cases are well-defined.
  1327   well-defined:
  1330 
  1328 
  1331   \begin{description}
  1329   \begin{description}
  1332 
  1330 
  1333   \item[No selection.] The original is removed and the replacement inserted,
  1331   \item[No selection.] The original is removed and the replacement inserted,
  1334   depending on the caret position.
  1332   depending on the caret position.
  1335 
  1333 
  1336   \item[Rectangular selection zero width.] This special case is treated by
  1334   \item[Rectangular selection of zero width.] This special case is treated by
  1337   jEdit as ``tall caret'' and insertion of completion imitates its normal
  1335   jEdit as ``tall caret'' and insertion of completion imitates its normal
  1338   behaviour: separate copies of the replacement are inserted for each line of
  1336   behaviour: separate copies of the replacement are inserted for each line of
  1339   the selection.
  1337   the selection.
  1340 
  1338 
  1341   \item[Other rectangular selection or multiple selections.] Here the original
  1339   \item[Other rectangular selection or multiple selections.] Here the original
  1346 
  1344 
  1347   Support for multiple selections is particularly useful for
  1345   Support for multiple selections is particularly useful for
  1348   \emph{HyperSearch}: clicking on one of the items in the \emph{HyperSearch
  1346   \emph{HyperSearch}: clicking on one of the items in the \emph{HyperSearch
  1349   Results} window makes jEdit select all its occurrences in the corresponding
  1347   Results} window makes jEdit select all its occurrences in the corresponding
  1350   line of text. Then explicit completion can be invoked via @{verbatim "C+b"},
  1348   line of text. Then explicit completion can be invoked via @{verbatim "C+b"},
  1351   for example to replace occurrences of @{verbatim "-->"} by @{text "\<longrightarrow>"}.
  1349   e.g.\ to replace occurrences of @{verbatim "-->"} by @{text "\<longrightarrow>"}.
  1352 
  1350 
  1353   \medskip Insertion works by removing and inserting pieces of text from the
  1351   \medskip Insertion works by removing and inserting pieces of text from the
  1354   buffer. This counts as one atomic operation on the jEdit history. Thus
  1352   buffer. This counts as one atomic operation on the jEdit history. Thus
  1355   unintended completions may be reverted by the regular @{action undo} action
  1353   unintended completions may be reverted by the regular @{action undo} action
  1356   of jEdit. According to normal jEdit policies, the recovered text after
  1354   of jEdit. According to normal jEdit policies, the recovered text after
  1451   \begin{itemize}
  1449   \begin{itemize}
  1452 
  1450 
  1453   \item @{system_option_ref auto_methods} controls automatic use of a
  1451   \item @{system_option_ref auto_methods} controls automatic use of a
  1454   combination of standard proof methods (@{method auto}, @{method
  1452   combination of standard proof methods (@{method auto}, @{method
  1455   simp}, @{method blast}, etc.).  This corresponds to the Isar command
  1453   simp}, @{method blast}, etc.).  This corresponds to the Isar command
  1456   @{command_ref "try0"}.
  1454   @{command_ref "try0"} \cite{isabelle-isar-ref}.
  1457 
  1455 
  1458   The tool is disabled by default, since unparameterized invocation of
  1456   The tool is disabled by default, since unparameterized invocation of
  1459   standard proof methods often consumes substantial CPU resources
  1457   standard proof methods often consumes substantial CPU resources
  1460   without leading to success.
  1458   without leading to success.
  1461 
  1459 
  1575   tooltip for the corresponding command keyword, using the technique
  1573   tooltip for the corresponding command keyword, using the technique
  1576   of mouse hovering with @{verbatim CONTROL}/@{verbatim COMMAND}
  1574   of mouse hovering with @{verbatim CONTROL}/@{verbatim COMMAND}
  1577   modifier key as explained in \secref{sec:tooltips-hyperlinks}.
  1575   modifier key as explained in \secref{sec:tooltips-hyperlinks}.
  1578   Actual display of timing depends on the global option
  1576   Actual display of timing depends on the global option
  1579   @{system_option_ref jedit_timing_threshold}, which can be configured in
  1577   @{system_option_ref jedit_timing_threshold}, which can be configured in
  1580   "Plugin Options~/ Isabelle~/ General".
  1578   \emph{Plugin Options~/ Isabelle~/ General}.
  1581 
  1579 
  1582   \medskip The \emph{Monitor} panel provides a general impression of
  1580   \medskip The \emph{Monitor} panel provides a general impression of
  1583   recent activity of the farm of worker threads in Isabelle/ML.  Its
  1581   recent activity of the farm of worker threads in Isabelle/ML.  Its
  1584   display is continuously updated according to @{system_option_ref
  1582   display is continuously updated according to @{system_option_ref
  1585   editor_chart_delay}.  Note that the painting of the chart takes
  1583   editor_chart_delay}.  Note that the painting of the chart takes
  1620   Peeking at physical process I/O is only the last resort to diagnose
  1618   Peeking at physical process I/O is only the last resort to diagnose
  1621   problems with tools that are not PIDE compliant.
  1619   problems with tools that are not PIDE compliant.
  1622 
  1620 
  1623   Under normal circumstances, prover output always works via managed message
  1621   Under normal circumstances, prover output always works via managed message
  1624   channels (corresponding to @{ML writeln}, @{ML warning}, @{ML
  1622   channels (corresponding to @{ML writeln}, @{ML warning}, @{ML
  1625   Output.error_message} etc.\ in Isabelle/ML), which are displayed by regular
  1623   Output.error_message} in Isabelle/ML), which are displayed by regular means
  1626   means within the document model (\secref{sec:output}).
  1624   within the document model (\secref{sec:output}).
  1627 
  1625 
  1628   \item \emph{Syslog} shows system messages that might be relevant to
  1626   \item \emph{Syslog} shows system messages that might be relevant to
  1629   diagnose problems with the startup or shutdown phase of the prover
  1627   diagnose problems with the startup or shutdown phase of the prover
  1630   process; this also includes raw output on @{verbatim stderr}.
  1628   process; this also includes raw output on @{verbatim stderr}.
  1631 
  1629 
  1681   (Do not install that font on the system.)
  1679   (Do not install that font on the system.)
  1682 
  1680 
  1683   \item \textbf{Problem:} Some Linux/X11 input methods such as IBus
  1681   \item \textbf{Problem:} Some Linux/X11 input methods such as IBus
  1684   tend to disrupt key event handling of Java/AWT/Swing.
  1682   tend to disrupt key event handling of Java/AWT/Swing.
  1685 
  1683 
  1686   \textbf{Workaround:} Do not use input methods, reset the environment
  1684   \textbf{Workaround:} Do not use X11 input methods. Note that environment
  1687   variable @{verbatim XMODIFIERS} within Isabelle settings (default in
  1685   variable @{verbatim XMODIFIERS} is reset by default within Isabelle
  1688   Isabelle2013-2).
  1686   settings.
  1689 
  1687 
  1690   \item \textbf{Problem:} Some Linux/X11 window managers that are
  1688   \item \textbf{Problem:} Some Linux/X11 window managers that are
  1691   not ``re-parenting'' cause problems with additional windows opened
  1689   not ``re-parenting'' cause problems with additional windows opened
  1692   by Java. This affects either historic or neo-minimalistic window
  1690   by Java. This affects either historic or neo-minimalistic window
  1693   managers like @{verbatim awesome} or @{verbatim xmonad}.
  1691   managers like @{verbatim awesome} or @{verbatim xmonad}.
  1694 
  1692 
  1695   \textbf{Workaround:} Use a regular re-parenting window manager.
  1693   \textbf{Workaround:} Use a regular re-parenting X11 window manager.
  1696 
  1694 
  1697   \item \textbf{Problem:} Recent forks of Linux/X11 window managers
  1695   \item \textbf{Problem:} Recent forks of Linux/X11 window managers
  1698   and desktop environments (variants of Gnome) disrupt the handling of
  1696   and desktop environments (variants of Gnome) disrupt the handling of
  1699   menu popups and mouse positions of Java/AWT/Swing.
  1697   menu popups and mouse positions of Java/AWT/Swing.
  1700 
  1698