clarified completion of Isabelle symbols within document source;
authorwenzelm
Mon, 02 Nov 2015 10:20:27 +0100
changeset 61537 f6bd97a587b7
parent 61536 346aa2c5447f
child 61538 bf4969660913
clarified completion of Isabelle symbols within document source;
NEWS
etc/options
src/Pure/PIDE/markup.ML
src/Pure/Thy/thy_output.ML
--- a/NEWS	Mon Nov 02 09:43:20 2015 +0100
+++ b/NEWS	Mon Nov 02 10:20:27 2015 +0100
@@ -79,6 +79,9 @@
 standard Isabelle fonts provide glyphs to render important control
 symbols, e.g. "\<^verbatim>", "\<^emph>", "\<^bold>".
 
+* System option "document_symbols" determines completion of Isabelle
+symbols within document source.
+
 * Antiquotation @{cartouche} in Isabelle/Pure is the same as @{text}.
 Consequently, \<open>...\<close> without any decoration prints literal quasi-formal
 text. Command-line tool "isabelle update_cartouches -t" helps to update
--- a/etc/options	Mon Nov 02 09:43:20 2015 +0100
+++ b/etc/options	Mon Nov 02 10:20:27 2015 +0100
@@ -164,3 +164,5 @@
 public option completion_limit : int = 40
   -- "limit for completion within the formal context"
 
+public option document_symbols : bool = false
+  -- "completion of Isabelle symbols within document source"
--- a/src/Pure/PIDE/markup.ML	Mon Nov 02 09:43:20 2015 +0100
+++ b/src/Pure/PIDE/markup.ML	Mon Nov 02 10:20:27 2015 +0100
@@ -36,7 +36,7 @@
   val language_prop: bool -> T
   val language_ML: bool -> T
   val language_SML: bool -> T
-  val language_document: bool -> T
+  val language_document: {symbols: bool, delimited: bool} -> T
   val language_antiquotation: T
   val language_text: bool -> T
   val language_rail: T
@@ -310,7 +310,8 @@
 val language_prop = language' {name = "prop", symbols = true, antiquotes = false};
 val language_ML = language' {name = "ML", symbols = false, antiquotes = true};
 val language_SML = language' {name = "SML", symbols = false, antiquotes = false};
-val language_document = language' {name = "document", symbols = false, antiquotes = true};
+fun language_document {symbols, delimited} =
+  language' {name = "document", symbols = symbols, antiquotes = true} delimited;
 val language_antiquotation =
   language {name = "antiquotation", symbols = true, antiquotes = false, delimited = true};
 val language_text = language' {name = "text", symbols = true, antiquotes = false};
--- a/src/Pure/Thy/thy_output.ML	Mon Nov 02 09:43:20 2015 +0100
+++ b/src/Pure/Thy/thy_output.ML	Mon Nov 02 10:20:27 2015 +0100
@@ -196,7 +196,10 @@
 fun output_text state {markdown} source =
   let
     val pos = Input.pos_of source;
-    val _ = Position.report pos (Markup.language_document (Input.is_delimited source));
+    val _ =
+      Position.report pos
+        (Markup.language_document
+          {symbols = Options.default_bool "document_symbols", delimited = Input.is_delimited source});
     val syms = Input.source_explode source;
 
     val output_antiquote = eval_antiquote state #> Symbol.explode #> Latex.output_ctrl_symbols;