src/Pure/PIDE/isar_document.scala
changeset 44615 a4ff8a787202
parent 44613 a3255c85327b
child 44644 317e4962dd0f
equal deleted inserted replaced
44614:466ea227e00d 44615:a4ff8a787202
   158   {
   158   {
   159     input("Isar_Document.cancel_execution")
   159     input("Isar_Document.cancel_execution")
   160   }
   160   }
   161 
   161 
   162   def update_perspective(old_id: Document.Version_ID, new_id: Document.Version_ID,
   162   def update_perspective(old_id: Document.Version_ID, new_id: Document.Version_ID,
   163     name: String, perspective: Command.Perspective)
   163     name: Document.Node.Name, perspective: Command.Perspective)
   164   {
   164   {
   165     val ids =
   165     val ids =
   166     { import XML.Encode._
   166     { import XML.Encode._
   167       list(long)(perspective.commands.map(_.id)) }
   167       list(long)(perspective.commands.map(_.id)) }
   168 
   168 
   169     input("Isar_Document.update_perspective", Document.ID(old_id), Document.ID(new_id), name,
   169     input("Isar_Document.update_perspective", Document.ID(old_id), Document.ID(new_id),
   170       YXML.string_of_body(ids))
   170       name.node, YXML.string_of_body(ids))
   171   }
   171   }
   172 
   172 
   173   def update(old_id: Document.Version_ID, new_id: Document.Version_ID,
   173   def update(old_id: Document.Version_ID, new_id: Document.Version_ID,
   174     edits: List[Document.Edit_Command])
   174     edits: List[Document.Edit_Command])
   175   {
   175   {
   176     val edits_yxml =
   176     val edits_yxml =
   177     { import XML.Encode._
   177     { import XML.Encode._
   178       def id: T[Command] = (cmd => long(cmd.id))
   178       def id: T[Command] = (cmd => long(cmd.id))
   179       def encode: T[List[Document.Edit_Command]] =
   179       def encode: T[List[Document.Edit_Command]] =
   180         list(pair(string,
   180         list(pair((name => string(name.node)),
   181           variant(List(
   181           variant(List(
   182             { case Document.Node.Clear() => (Nil, Nil) },
   182             { case Document.Node.Clear() => (Nil, Nil) },
   183             { case Document.Node.Edits(a) => (Nil, list(pair(option(id), option(id)))(a)) },
   183             { case Document.Node.Edits(a) => (Nil, list(pair(option(id), option(id)))(a)) },
   184             { case Document.Node.Header(Exn.Res(Thy_Header(a, b, c))) =>
   184             { case Document.Node.Header(Exn.Res(Thy_Header(a, b, c))) =>
   185                 (Nil, triple(string, list(string), list(pair(string, bool)))(a, b, c)) },
   185                 (Nil, triple(string, list(string), list(pair(string, bool)))(a, b, c)) },