src/Pure/context_position.ML
author wenzelm
Mon Sep 29 21:26:26 2008 +0200 (2008-09-29)
changeset 28409 a1feb819b0a2
parent 28405 000dee6d5d80
child 29606 fedb8be05f24
permissions -rw-r--r--
renamed report to report_visible;
tuned comments;
wenzelm@28405
     1
(*  Title:      Pure/context_position.ML
wenzelm@28405
     2
    ID:         $Id$
wenzelm@28405
     3
    Author:     Makarius
wenzelm@28405
     4
wenzelm@28409
     5
Context position visibility flag.
wenzelm@28405
     6
*)
wenzelm@28405
     7
wenzelm@28405
     8
signature CONTEXT_POSITION =
wenzelm@28405
     9
sig
wenzelm@28405
    10
  val is_visible: Proof.context -> bool
wenzelm@28405
    11
  val set_visible: bool -> Proof.context -> Proof.context
wenzelm@28405
    12
  val restore_visible: Proof.context -> Proof.context -> Proof.context
wenzelm@28409
    13
  val report_visible: Proof.context -> Markup.T -> Position.T -> unit
wenzelm@28405
    14
end;
wenzelm@28405
    15
wenzelm@28405
    16
structure ContextPosition: CONTEXT_POSITION =
wenzelm@28405
    17
struct
wenzelm@28405
    18
wenzelm@28405
    19
structure Data = ProofDataFun
wenzelm@28405
    20
(
wenzelm@28405
    21
  type T = bool;
wenzelm@28405
    22
  fun init _ = true;
wenzelm@28405
    23
);
wenzelm@28405
    24
wenzelm@28405
    25
val is_visible = Data.get;
wenzelm@28405
    26
val set_visible = Data.put;
wenzelm@28405
    27
val restore_visible = set_visible o is_visible;
wenzelm@28405
    28
wenzelm@28409
    29
fun report_visible ctxt markup pos =
wenzelm@28405
    30
  if is_visible ctxt then Position.report markup pos else ();
wenzelm@28405
    31
wenzelm@28405
    32
end;