src/Doc/JEdit/JEdit.thy
changeset 54358 0f50303e899f
parent 54357 157b6eee6a76
child 54359 e649dff217ae
equal deleted inserted replaced
54357:157b6eee6a76 54358:0f50303e899f
   830   find_theorems} to the current context of the command where the
   830   find_theorems} to the current context of the command where the
   831   cursor is pointing in the text, unless an alternative theory context
   831   cursor is pointing in the text, unless an alternative theory context
   832   (from the underlying logic image) is specified explicitly. *}
   832   (from the underlying logic image) is specified explicitly. *}
   833 
   833 
   834 
   834 
       
   835 chapter {* Miscellaneous tools *}
       
   836 
       
   837 section {* SideKick *}
       
   838 
       
   839 text {* The \emph{SideKick} plugin of jEdit provides some general
       
   840   services to display buffer structure in a tree view.
       
   841 
       
   842   Isabelle/jEdit provides SideKick parsers for its main mode for
       
   843   theory files, as well as some minor modes for the @{verbatim NEWS}
       
   844   file, session @{verbatim ROOT} files, and @{verbatim options}.
       
   845 
       
   846   Moreover, the special SideKick parser @{verbatim "isabelle-markup"}
       
   847   provides access to the full (uninterpreted) markup tree of the PIDE
       
   848   document model of the current buffer.  This is occasionally useful
       
   849   for informative purposes, but the amount of displayed information
       
   850   might cause problems for large buffers, both for the human and the
       
   851   machine.
       
   852 *}
       
   853 
       
   854 
       
   855 section {* Isabelle/Scala console *}
       
   856 
       
   857 text {* The \emph{Console} plugin of jEdit manages various shells
       
   858   (command interpreters), e.g.\ \emph{BeanShell}, which is the
       
   859   official jEdit scripting language, and the somewhat
       
   860   platform-independent \emph{System} shell.  Thus the console provides
       
   861   similar functionality than the special buffers @{verbatim
       
   862   "*scratch*"} and @{verbatim "*shell*"} in Emacs.
       
   863 
       
   864   Isabelle/jEdit extends the repertoire of the console by
       
   865   \emph{Scala}, which is the regular Scala toplevel loop running
       
   866   inside the \emph{same} JVM process as Isabelle/jEdit itself.  This
       
   867   means the Scala command interpreter has access to the JVM name space
       
   868   and state of the running Prover IDE application: the main entry
       
   869   points are @{verbatim view} (the current editor view of jEdit) and
       
   870   @{verbatim PIDE} (the Isabelle/jEdit plugin object).
       
   871 
       
   872   For example, the subsequent Scala snippet gets the PIDE document
       
   873   model of the current buffer within the current editor view:
       
   874 
       
   875   \begin{center}
       
   876   @{verbatim "PIDE.document_model(view.getBuffer).get"}
       
   877   \end{center}
       
   878 
       
   879   This helps to explore Isabelle/Scala functionality interactively.
       
   880   Some care is required to avoid interference with the internals of
       
   881   the running application, especially in production use.  *}
       
   882 
       
   883 
       
   884 section {* Low-level output *}
       
   885 
       
   886 text {* Prover output is normally shown directly in the main text area
       
   887   or adjacent \emph{Output} panels, as explained in
       
   888   \secref{sec:prover-output}.
       
   889 
       
   890   Beyond this, it is occasionally useful to inspect low-level output
       
   891   channels via some of the following additional panels:
       
   892 
       
   893   \begin{itemize}
       
   894 
       
   895   \item \emph{Protocol} shows internal messages between the
       
   896   Isabelle/Scala and Isabelle/ML side of the PIDE editing protocol.
       
   897   Recording of messages starts with the first activation of the
       
   898   corresponding dockable window; earlier messages are lost.
       
   899 
       
   900   Actual display of protocol messages causes considerable slowdown, so
       
   901   it is important to ``undock'' the \emph{Protocol} panel for
       
   902   production work.
       
   903 
       
   904   \item \emph{Raw Output} shows chunks of text from the @{verbatim
       
   905   stdout} and @{verbatim stderr} channels of the prover process.
       
   906   Recording of output starts with the first activation of the
       
   907   corresponding dockable window; earlier output is lost.
       
   908 
       
   909   The implicit stateful nature of physical I/O channels makes it
       
   910   difficult to relate raw output to the actual command from where it
       
   911   was originating.  Parallel execution may add to the confusion.
       
   912   Peeking at physical process I/O is only the last resort to diagnose
       
   913   problems with tools that are not fully PIDE compliant.
       
   914 
       
   915   Under normal circumstances, prover output always works via managed
       
   916   message channels (corresponding to @{ML writeln}, @{ML warning},
       
   917   @{ML error} etc.\ in Isabelle/ML), which are displayed by regular
       
   918   means within the document model (\secref{sec:prover-output}).
       
   919 
       
   920   \item \emph{Syslog} shows system messages that might be relevant to
       
   921   diagnose problems with the startup or shutdown phase of the prover
       
   922   process; this also includes raw output on @{verbatim stderr}.
       
   923 
       
   924   A limited amount of syslog messages are buffered, independently of
       
   925   the docking state of the \emph{Syslog} panel.  This allows to
       
   926   diagnose serious problems with Isabelle/PIDE process management,
       
   927   outside of the actual protocol layer.
       
   928 
       
   929   Under normal situations, such low-level system output can be
       
   930   ignored.
       
   931 
       
   932   \end{itemize}
       
   933 *}
       
   934 
       
   935 
   835 chapter {* Known problems and workarounds \label{sec:problems} *}
   936 chapter {* Known problems and workarounds \label{sec:problems} *}
   836 
   937 
   837 text {*
   938 text {*
   838   \begin{itemize}
   939   \begin{itemize}
   839 
   940