author | wenzelm |
Sun, 08 Aug 2010 19:54:54 +0200 | |
changeset 38237 | 8b0383334031 |
parent 33519 | e31a85f92ce9 |
child 38481 | 81ec258c4cd3 |
permissions | -rw-r--r-- |
28405 | 1 |
(* Title: Pure/context_position.ML |
2 |
Author: Makarius |
|
3 |
||
28409 | 4 |
Context position visibility flag. |
28405 | 5 |
*) |
6 |
||
7 |
signature CONTEXT_POSITION = |
|
8 |
sig |
|
9 |
val is_visible: Proof.context -> bool |
|
10 |
val set_visible: bool -> Proof.context -> Proof.context |
|
11 |
val restore_visible: Proof.context -> Proof.context -> Proof.context |
|
38237
8b0383334031
prefer Context_Position.report where a proper context is available -- notably for "inner" entities;
wenzelm
parents:
33519
diff
changeset
|
12 |
val report: Proof.context -> Markup.T -> Position.T -> unit |
28405 | 13 |
end; |
14 |
||
33383 | 15 |
structure Context_Position: CONTEXT_POSITION = |
28405 | 16 |
struct |
17 |
||
33519 | 18 |
structure Data = Proof_Data |
28405 | 19 |
( |
20 |
type T = bool; |
|
21 |
fun init _ = true; |
|
22 |
); |
|
23 |
||
24 |
val is_visible = Data.get; |
|
25 |
val set_visible = Data.put; |
|
26 |
val restore_visible = set_visible o is_visible; |
|
27 |
||
38237
8b0383334031
prefer Context_Position.report where a proper context is available -- notably for "inner" entities;
wenzelm
parents:
33519
diff
changeset
|
28 |
fun report ctxt markup pos = |
28405 | 29 |
if is_visible ctxt then Position.report markup pos else (); |
30 |
||
31 |
end; |