src/Pure/Isar/isar_cmd.ML
changeset 58875 ab1c65b015c3
parent 58868 c5e1cce7ace3
child 58928 23d0ffd48006
equal deleted inserted replaced
58874:7172c7ffb047 58875:ab1c65b015c3
    49   val print_type: (string list * (string * string option)) ->
    49   val print_type: (string list * (string * string option)) ->
    50     Toplevel.transition -> Toplevel.transition
    50     Toplevel.transition -> Toplevel.transition
    51   val local_theory_markup: (xstring * Position.T) option * Symbol_Pos.source ->
    51   val local_theory_markup: (xstring * Position.T) option * Symbol_Pos.source ->
    52     Toplevel.transition -> Toplevel.transition
    52     Toplevel.transition -> Toplevel.transition
    53   val proof_markup: Symbol_Pos.source -> Toplevel.transition -> Toplevel.transition
    53   val proof_markup: Symbol_Pos.source -> Toplevel.transition -> Toplevel.transition
       
    54   val header_markup: Symbol_Pos.source -> Toplevel.transition -> Toplevel.transition
    54   val heading_markup: (xstring * Position.T) option * Symbol_Pos.source ->
    55   val heading_markup: (xstring * Position.T) option * Symbol_Pos.source ->
    55     Toplevel.transition -> Toplevel.transition
    56     Toplevel.transition -> Toplevel.transition
    56 end;
    57 end;
    57 
    58 
    58 structure Isar_Cmd: ISAR_CMD =
    59 structure Isar_Cmd: ISAR_CMD =
   383 
   384 
   384 fun reject_target NONE = ()
   385 fun reject_target NONE = ()
   385   | reject_target (SOME (_, pos)) =
   386   | reject_target (SOME (_, pos)) =
   386       error ("Illegal target specification -- not a theory context" ^ Position.here pos);
   387       error ("Illegal target specification -- not a theory context" ^ Position.here pos);
   387 
   388 
   388 fun heading_markup (loc, txt) =
   389 fun header_markup txt =
   389   Toplevel.keep (fn state =>
   390   Toplevel.keep (fn state =>
   390     if Toplevel.is_toplevel state then
   391     if Toplevel.is_toplevel state then
   391      (legacy_feature "Obsolete 'header' command -- use 'chapter', 'section' etc. instead";
   392      (legacy_feature "Obsolete 'header' command -- use 'chapter', 'section' etc. instead";
   392       reject_target loc;
       
   393       Thy_Output.check_text txt state)
   393       Thy_Output.check_text txt state)
       
   394     else raise Toplevel.UNDEF);
       
   395 
       
   396 fun heading_markup (loc, txt) =
       
   397   Toplevel.keep (fn state =>
       
   398     if Toplevel.is_toplevel state then (reject_target loc; Thy_Output.check_text txt state)
   394     else raise Toplevel.UNDEF) o
   399     else raise Toplevel.UNDEF) o
   395   local_theory_markup (loc, txt) o
   400   local_theory_markup (loc, txt) o
   396   Toplevel.present_proof (fn state => (reject_target loc; Thy_Output.check_text txt state));
   401   Toplevel.present_proof (fn state => (reject_target loc; Thy_Output.check_text txt state));
   397 
   402 
   398 end;
   403 end;