more markup: disable spell-checker for raw latex;
authorwenzelm
Thu, 25 Jan 2018 15:21:05 +0100
changeset 67506 30233285270a
parent 67505 ceb324e34c14
child 67507 5db077cfe1b2
more markup: disable spell-checker for raw latex;
etc/options
src/Pure/General/comment.ML
src/Pure/PIDE/markup.ML
src/Pure/Thy/thy_output.ML
--- a/etc/options	Thu Jan 25 14:13:55 2018 +0100
+++ b/etc/options	Thu Jan 25 15:21:05 2018 +0100
@@ -217,7 +217,7 @@
 public option spell_checker_include : string = "words,comment,inner_comment,ML_comment,SML_comment"
   -- "included markup elements for spell-checker (separated by commas)"
 
-public option spell_checker_exclude : string = "antiquoted"
+public option spell_checker_exclude : string = "no_words,antiquoted"
   -- "excluded markup elements for spell-checker (separated by commas)"
 
 
--- a/src/Pure/General/comment.ML	Thu Jan 25 14:13:55 2018 +0100
+++ b/src/Pure/General/comment.ML	Thu Jan 25 15:21:05 2018 +0100
@@ -7,7 +7,7 @@
 signature COMMENT =
 sig
   datatype kind = Comment | Cancel | Latex
-  val markup: kind -> Markup.T
+  val markups: kind -> Markup.T list
   val scan_comment: (kind * Symbol_Pos.T list) scanner
   val scan_cancel: (kind * Symbol_Pos.T list) scanner
   val scan_latex: (kind * Symbol_Pos.T list) scanner
@@ -23,13 +23,19 @@
 datatype kind = Comment | Cancel | Latex;
 
 val kinds =
-  [(Comment, {symbol = Symbol.comment, blanks = true, markup = Markup.language_document true}),
-   (Cancel, {symbol = Symbol.cancel, blanks = false, markup = Markup.language_text true}),
-   (Latex, {symbol = Symbol.latex, blanks = false, markup = Markup.language_latex true})];
+  [(Comment,
+     {symbol = Symbol.comment, blanks = true,
+      markups = [Markup.language_document true]}),
+   (Cancel,
+     {symbol = Symbol.cancel, blanks = false,
+      markups = [Markup.language_text true]}),
+   (Latex,
+     {symbol = Symbol.latex, blanks = false,
+      markups = [Markup.language_latex true, Markup.no_words]})];
 
 val get_kind = the o AList.lookup (op =) kinds;
 val print_kind = quote o #symbol o get_kind;
-val markup = #markup o get_kind;
+val markups = #markups o get_kind;
 
 fun is_symbol sym = exists (fn (_, {symbol, ...}) => symbol = sym) kinds;
 
--- a/src/Pure/PIDE/markup.ML	Thu Jan 25 14:13:55 2018 +0100
+++ b/src/Pure/PIDE/markup.ML	Thu Jan 25 15:21:05 2018 +0100
@@ -71,6 +71,7 @@
   val fbreakN: string val fbreak: T
   val itemN: string val item: T
   val wordsN: string val words: T
+  val no_wordsN: string val no_words: T
   val hiddenN: string val hidden: T
   val system_optionN: string
   val sessionN: string
@@ -393,6 +394,7 @@
 (* text properties *)
 
 val (wordsN, words) = markup_elem "words";
+val (no_wordsN, no_words) = markup_elem "no_words";
 
 val (hiddenN, hidden) = markup_elem "hidden";
 
--- a/src/Pure/Thy/thy_output.ML	Thu Jan 25 14:13:55 2018 +0100
+++ b/src/Pure/Thy/thy_output.ML	Thu Jan 25 15:21:05 2018 +0100
@@ -147,7 +147,7 @@
       val pos = #1 (Symbol_Pos.range syms);
       val _ =
         comment |> Option.app (fn kind =>
-          Context_Position.reports ctxt [(pos, Comment.markup kind), (pos, Markup.cartouche)]);
+          Context_Position.reports ctxt (map (pair pos) (Markup.cartouche :: Comment.markups kind)));
       val _ = output_symbols_comment ctxt {antiq = false} (comment, syms);
     in if comment = SOME Comment.Comment then check_comments ctxt syms else () end);