src/Pure/context_position.ML
author wenzelm
Fri May 28 20:41:23 2010 +0200 (2010-05-28)
changeset 37174 6feaab4fc27d
parent 33519 e31a85f92ce9
child 38237 8b0383334031
permissions -rw-r--r--
assume given SCALA_HOME, e.g. from component settings or external setup;
     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 Context_Position: CONTEXT_POSITION =
    16 struct
    17 
    18 structure Data = Proof_Data
    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;