equal
deleted
inserted
replaced
1 (* Title: Pure/ProofGeneral/proof_general_emacs.ML |
1 (* Title: Pure/ProofGeneral/proof_general_emacs.ML |
2 ID: $Id$ |
2 ID: $Id$ |
3 Author: David Aspinall and Markus Wenzel |
3 Author: David Aspinall and Markus Wenzel |
4 |
4 |
5 Isabelle/Isar configuration for Emacs Proof General. |
5 Isabelle/Isar configuration for Emacs Proof General. |
6 See http://proofgeneral.inf.ed.ac.uk |
6 See also http://proofgeneral.inf.ed.ac.uk |
7 *) |
7 *) |
8 |
8 |
9 signature PROOF_GENERAL = |
9 signature PROOF_GENERAL = |
10 sig |
10 sig |
|
11 val test_markupN: string |
11 val init: bool -> unit |
12 val init: bool -> unit |
12 val init_outer_syntax: unit -> unit |
13 val init_outer_syntax: unit -> unit |
13 val sendback: string -> Pretty.T list -> unit |
14 val sendback: string -> Pretty.T list -> unit |
14 end; |
15 end; |
15 |
16 |
20 (* print modes *) |
21 (* print modes *) |
21 |
22 |
22 val proof_generalN = "ProofGeneralEmacs"; (*token markup (colouring vars, etc.)*) |
23 val proof_generalN = "ProofGeneralEmacs"; (*token markup (colouring vars, etc.)*) |
23 val pgasciiN = "PGASCII"; (*plain 7-bit ASCII communication*) |
24 val pgasciiN = "PGASCII"; (*plain 7-bit ASCII communication*) |
24 val thm_depsN = "thm_deps"; (*meta-information about theorem deps*) |
25 val thm_depsN = "thm_deps"; (*meta-information about theorem deps*) |
|
26 val test_markupN = "test_markup"; (*XML markup for everything*) |
|
27 |
|
28 val _ = Markup.add_mode test_markupN XML.output_markup; |
25 |
29 |
26 fun special oct = |
30 fun special oct = |
27 if print_mode_active pgasciiN then Symbol.SOH ^ chr (ord (oct_char oct) - 167) |
31 if print_mode_active pgasciiN then Symbol.SOH ^ chr (ord (oct_char oct) - 167) |
28 else oct_char oct; |
32 else oct_char oct; |
29 |
33 |
105 if name = Markup.stateN then (special "366" ^ "\n", "\n" ^ special "367") |
109 if name = Markup.stateN then (special "366" ^ "\n", "\n" ^ special "367") |
106 else if name = Markup.sendbackN then (special "376", special "377") |
110 else if name = Markup.sendbackN then (special "376", special "377") |
107 else if name = Markup.hiliteN then (special "327", special "330") |
111 else if name = Markup.hiliteN then (special "327", special "330") |
108 else ("", ""); |
112 else ("", ""); |
109 val (bg2, en2) = |
113 val (bg2, en2) = |
110 if print_mode_active IsabelleProcess.test_markupN |
114 if print_mode_active test_markupN |
111 then XML.output_markup (name, props) |
115 then XML.output_markup (name, props) |
112 else ("", ""); |
116 else ("", ""); |
113 in (bg1 ^ bg2, en2 ^ en1) end; |
117 in (bg1 ^ bg2, en2 ^ en1) end; |
114 |
118 |
115 val _ = Markup.add_mode proof_generalN proof_general_markup; |
119 val _ = Markup.add_mode proof_generalN proof_general_markup; |