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
|
28409
|
12 |
val report_visible: 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 |
|
28409
|
28 |
fun report_visible ctxt markup pos =
|
28405
|
29 |
if is_visible ctxt then Position.report markup pos else ();
|
|
30 |
|
|
31 |
end;
|