src/Doc/JEdit/JEdit.thy
changeset 62250 9cf61c91b274
parent 62249 c1d6dfd645e2
child 62251 460273b88e64
equal deleted inserted replaced
62249:c1d6dfd645e2 62250:9cf61c91b274
  1259 
  1259 
  1260   A symbol abbreviation that is a plain word, like \<^verbatim>\<open>ALL\<close>, is treated like a
  1260   A symbol abbreviation that is a plain word, like \<^verbatim>\<open>ALL\<close>, is treated like a
  1261   syntax keyword. Non-word abbreviations like \<^verbatim>\<open>-->\<close> are inserted more
  1261   syntax keyword. Non-word abbreviations like \<^verbatim>\<open>-->\<close> are inserted more
  1262   aggressively, except for single-character abbreviations like \<^verbatim>\<open>!\<close> above.
  1262   aggressively, except for single-character abbreviations like \<^verbatim>\<open>!\<close> above.
  1263 
  1263 
       
  1264   Completion via abbreviations like \<^verbatim>\<open>ALL\<close> or \<^verbatim>\<open>-->\<close> depends on the semantic
       
  1265   language context (\secref{sec:completion-context}). In contrast, backslash
       
  1266   sequences like \<^verbatim>\<open>\forall\<close> \<^verbatim>\<open>\<forall>\<close> are always possible, but require
       
  1267   additional interaction to confirm (via popup).
       
  1268 
       
  1269   The latter is important in ambiguous situations, e.g.\ for Isabelle document
       
  1270   source, which may contain formal symbols or informal {\LaTeX} macros.
       
  1271   Backslash sequences also help when input is broken, and thus escapes its
       
  1272   normal semantic context: e.g.\ antiquotations or string literals in ML,
       
  1273   which do not allow arbitrary backslash sequences.
       
  1274 
  1264   \<^medskip>
  1275   \<^medskip>
  1265   Additional abbreviations may be specified in @{file
  1276   Additional abbreviations may be specified in @{file
  1266   "$ISABELLE_HOME/etc/abbrevs"} and @{file_unchecked
  1277   "$ISABELLE_HOME/etc/abbrevs"} and @{file_unchecked
  1267   "$ISABELLE_HOME_USER/etc/abbrevs"}. The file content follows general Isar
  1278   "$ISABELLE_HOME_USER/etc/abbrevs"}. The file content follows general Isar
  1268   outer syntax @{cite "isabelle-isar-ref"}. Abbreviations are specified as
  1279   outer syntax @{cite "isabelle-isar-ref"}. Abbreviations are specified as
  1269   ``\<open>abbrev\<close>~\<^verbatim>\<open>=\<close>~\<open>text\<close>'' pairs. The replacement \<open>text\<close> may consist of more
  1280   ``\<open>abbrev\<close>~\<^verbatim>\<open>=\<close>~\<open>text\<close>'' pairs. The replacement \<open>text\<close> may consist of more
  1270   than just one symbol; otherwise the meaning is the same as a symbol
  1281   than just one symbol; otherwise the meaning is the same as a symbol
  1271   specification ``\<open>sym\<close>~\<^verbatim>\<open>abbrev:\<close>~\<open>abbrev\<close>'' within @{file_unchecked
  1282   specification ``\<open>sym\<close>~\<^verbatim>\<open>abbrev:\<close>~\<open>abbrev\<close>'' within @{file_unchecked
  1272   "etc/symbols"}.
  1283   "etc/symbols"}.
  1273 
       
  1274   \<^medskip>
       
  1275   Symbol completion depends on the semantic language context
       
  1276   (\secref{sec:completion-context}), to enable or disable that aspect for a
       
  1277   particular sub-language of Isabelle. For example, symbol completion is
       
  1278   suppressed within document source to avoid confusion with {\LaTeX} macros
       
  1279   that use similar notation.
       
  1280 \<close>
  1284 \<close>
  1281 
  1285 
  1282 
  1286 
  1283 subsubsection \<open>Name-space entries\<close>
  1287 subsubsection \<open>Name-space entries\<close>
  1284 
  1288 
  1306 
  1310 
  1307 
  1311 
  1308 subsubsection \<open>File-system paths\<close>
  1312 subsubsection \<open>File-system paths\<close>
  1309 
  1313 
  1310 text \<open>
  1314 text \<open>
  1311   Depending on prover markup about file-system path specifications in the
  1315   Depending on prover markup about file-system paths in the source text, e.g.\
  1312   source text, e.g.\ for the argument of a load command
  1316   for the argument of a load command (\secref{sec:aux-files}), the completion
  1313   (\secref{sec:aux-files}), the completion mechanism explores the directory
  1317   mechanism explores the directory content and offers the result as completion
  1314   content and offers the result as completion popup. Relative path
  1318   popup. Relative path specifications are understood wrt.\ the \<^emph>\<open>master
  1315   specifications are understood wrt.\ the \<^emph>\<open>master directory\<close> of the document
  1319   directory\<close> of the document node (\secref{sec:buffer-node}) of the enclosing
  1316   node (\secref{sec:buffer-node}) of the enclosing editor buffer; this
  1320   editor buffer; this requires a proper theory, not an auxiliary file.
  1317   requires a proper theory, not an auxiliary file.
       
  1318 
  1321 
  1319   A suffix of slashes may be used to continue the exploration of an already
  1322   A suffix of slashes may be used to continue the exploration of an already
  1320   recognized directory name.
  1323   recognized directory name.
  1321 \<close>
  1324 \<close>
  1322 
  1325 
  1347   default keyboard shortcut \<^verbatim>\<open>C+b\<close>.
  1350   default keyboard shortcut \<^verbatim>\<open>C+b\<close>.
  1348 
  1351 
  1349   \<^medskip>
  1352   \<^medskip>
  1350   Dictionary lookup uses some educated guesses about lower-case, upper-case,
  1353   Dictionary lookup uses some educated guesses about lower-case, upper-case,
  1351   and capitalized words. This is oriented on common use in English, where this
  1354   and capitalized words. This is oriented on common use in English, where this
  1352   aspect is not decisive for proper spelling, in contrast to German, for
  1355   aspect is not decisive for proper spelling (in contrast to German, for
  1353   example.
  1356   example).
  1354 \<close>
  1357 \<close>
  1355 
  1358 
  1356 
  1359 
  1357 subsection \<open>Semantic completion context \label{sec:completion-context}\<close>
  1360 subsection \<open>Semantic completion context \label{sec:completion-context}\<close>
  1358 
  1361 
  1362   is required. Until that information becomes available in the PIDE
  1365   is required. Until that information becomes available in the PIDE
  1363   document-model, the default context is given by the outer syntax of the
  1366   document-model, the default context is given by the outer syntax of the
  1364   editor mode (see also \secref{sec:buffer-node}).
  1367   editor mode (see also \secref{sec:buffer-node}).
  1365 
  1368 
  1366   The semantic \<^emph>\<open>language context\<close> provides information about nested
  1369   The semantic \<^emph>\<open>language context\<close> provides information about nested
  1367   sub-languages of Isabelle: keywords are only completed for outer syntax,
  1370   sub-languages of Isabelle: keywords are only completed for outer syntax, and
  1368   symbols or antiquotations for languages that support them. E.g.\ there is no
  1371   antiquotations for languages that support them. Symbol abbreviations only
  1369   symbol completion for ML source, but within ML strings, comments,
  1372   work for specific sub-languages: e.g.\ ``\<^verbatim>\<open>=>\<close>'' is \<^emph>\<open>not\<close> completed in
  1370   antiquotations.
  1373   regular ML source, but is completed within ML strings, comments,
       
  1374   antiquotations. Backslash representations of symbols like ``\<^verbatim>\<open>\foobar\<close>'' or
       
  1375   ``\<^verbatim>\<open>\<foobar>\<close>'' work in any context --- after additional confirmation.
  1371 
  1376 
  1372   The prover may produce \<^emph>\<open>no completion\<close> markup in exceptional situations, to
  1377   The prover may produce \<^emph>\<open>no completion\<close> markup in exceptional situations, to
  1373   tell that some language keywords should be excluded from further completion
  1378   tell that some language keywords should be excluded from further completion
  1374   attempts. For example, \<^verbatim>\<open>:\<close> within accepted Isar syntax looses its meaning
  1379   attempts. For example, ``\<^verbatim>\<open>:\<close>'' within accepted Isar syntax looses its
  1375   as abbreviation for symbol \<open>\<in>\<close>.
  1380   meaning as abbreviation for symbol ``\<open>\<in>\<close>''.
  1376 
       
  1377   \<^medskip>
       
  1378   The completion context is \<^emph>\<open>ignored\<close> for built-in templates and symbols in
       
  1379   their explicit form ``\<^verbatim>\<open>\<foobar>\<close>''; see also
       
  1380   \secref{sec:completion-varieties}. This allows to complete within broken
       
  1381   input that escapes its normal semantic context, e.g.\ antiquotations or
       
  1382   string literals in ML, which do not allow arbitrary backslash sequences.
       
  1383 \<close>
  1381 \<close>
  1384 
  1382 
  1385 
  1383 
  1386 subsection \<open>Input events \label{sec:completion-input}\<close>
  1384 subsection \<open>Input events \label{sec:completion-input}\<close>
  1387 
  1385 
  1416 
  1414 
  1417     \<^enum> The system option @{system_option_ref jedit_completion_immediate}
  1415     \<^enum> The system option @{system_option_ref jedit_completion_immediate}
  1418     (enabled by default) controls whether replacement text should be inserted
  1416     (enabled by default) controls whether replacement text should be inserted
  1419     immediately without popup, regardless of @{system_option
  1417     immediately without popup, regardless of @{system_option
  1420     jedit_completion_delay}. This aggressive mode of completion is restricted
  1418     jedit_completion_delay}. This aggressive mode of completion is restricted
  1421     to Isabelle symbols and their abbreviations (\secref{sec:symbols}).
  1419     to symbol abbreviations that are not plain words (\secref{sec:symbols}).
  1422 
  1420 
  1423     \<^enum> Completion of symbol abbreviations with only one relevant character in
  1421     \<^enum> Completion of symbol abbreviations with only one relevant character in
  1424     the text always enforces an explicit popup, regardless of
  1422     the text always enforces an explicit popup, regardless of
  1425     @{system_option_ref jedit_completion_immediate}.
  1423     @{system_option_ref jedit_completion_immediate}.
  1426 \<close>
  1424 \<close>
  1435   frequency of selection, with persistent history. The popup may interpret
  1433   frequency of selection, with persistent history. The popup may interpret
  1436   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>,
  1434   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>,
  1437   \<^verbatim>\<open>PAGE_DOWN\<close>, but all other key events are passed to the underlying text
  1435   \<^verbatim>\<open>PAGE_DOWN\<close>, but all other key events are passed to the underlying text
  1438   area. This allows to ignore unwanted completions most of the time and
  1436   area. This allows to ignore unwanted completions most of the time and
  1439   continue typing quickly. Thus the popup serves as a mechanism of
  1437   continue typing quickly. Thus the popup serves as a mechanism of
  1440   confirmation of proposed items, but the default is to continue without
  1438   confirmation of proposed items, while the default is to continue without
  1441   completion.
  1439   completion.
  1442 
  1440 
  1443   The meaning of special keys is as follows:
  1441   The meaning of special keys is as follows:
  1444 
  1442 
  1445   \<^medskip>
  1443   \<^medskip>
  1530   jedit_completion_immediate} determine the handling of keyboard events for
  1528   jedit_completion_immediate} determine the handling of keyboard events for
  1531   implicit completion (\secref{sec:completion-input}).
  1529   implicit completion (\secref{sec:completion-input}).
  1532 
  1530 
  1533   A @{system_option jedit_completion_delay}~\<^verbatim>\<open>> 0\<close> postpones the processing of
  1531   A @{system_option jedit_completion_delay}~\<^verbatim>\<open>> 0\<close> postpones the processing of
  1534   key events, until after the user has stopped typing for the given time span,
  1532   key events, until after the user has stopped typing for the given time span,
  1535   but @{system_option jedit_completion_immediate}~\<^verbatim>\<open>"= true\<close> means that
  1533   but @{system_option jedit_completion_immediate}~\<^verbatim>\<open>= true\<close> means that
  1536   abbreviations of Isabelle symbols are handled nonetheless.
  1534   abbreviations of Isabelle symbols are handled nonetheless.
  1537 
  1535 
  1538   \<^item> @{system_option_def jedit_completion_path_ignore} specifies ``glob''
  1536   \<^item> @{system_option_def jedit_completion_path_ignore} specifies ``glob''
  1539   patterns to ignore in file-system path completion (separated by colons),
  1537   patterns to ignore in file-system path completion (separated by colons),
  1540   e.g.\ backup files ending with tilde.
  1538   e.g.\ backup files ending with tilde.