src/Pure/context_position.ML
author haftmann
Tue Oct 20 16:13:01 2009 +0200 (2009-10-20)
changeset 33037 b22e44496dc2
parent 29606 fedb8be05f24
child 33383 12d79ece3f7e
permissions -rw-r--r--
replaced old_style infixes eq_set, subset, union, inter and variants by generic versions
     1 (*  Title:      Pure/context_position.ML
     2     Author:     Makarius
     3 
     4 Context position visibility flag.
     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
    12   val report_visible: Proof.context -> Markup.T -> Position.T -> unit
    13 end;
    14 
    15 structure ContextPosition: CONTEXT_POSITION =
    16 struct
    17 
    18 structure Data = ProofDataFun
    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 
    28 fun report_visible ctxt markup pos =
    29   if is_visible ctxt then Position.report markup pos else ();
    30 
    31 end;