175 doc_edits: List[Document.Edit_Command], |
175 doc_edits: List[Document.Edit_Command], |
176 previous: Document.Version, |
176 previous: Document.Version, |
177 version: Document.Version) |
177 version: Document.Version) |
178 private case class Messages(msgs: List[Isabelle_Process.Message]) |
178 private case class Messages(msgs: List[Isabelle_Process.Message]) |
179 private case class Finished_Scala(id: String, tag: Invoke_Scala.Tag.Value, result: String) |
179 private case class Finished_Scala(id: String, tag: Invoke_Scala.Tag.Value, result: String) |
|
180 private case class Update_Options(options: Options) |
180 |
181 |
181 private val (_, session_actor) = Simple_Thread.actor("session_actor", daemon = true) |
182 private val (_, session_actor) = Simple_Thread.actor("session_actor", daemon = true) |
182 { |
183 { |
183 val this_actor = self |
184 val this_actor = self |
184 |
185 |
413 } |
414 } |
414 finished = true |
415 finished = true |
415 receiver.cancel() |
416 receiver.cancel() |
416 reply(()) |
417 reply(()) |
417 |
418 |
418 case Session.Global_Options(options) if prover.isDefined => |
419 case Update_Options(options) if prover.isDefined => |
419 if (is_ready) prover.get.options(options) |
420 if (is_ready) prover.get.options(options) |
|
421 global_options.event(Session.Global_Options(options)) |
|
422 reply(()) |
420 |
423 |
421 case Cancel_Execution if prover.isDefined => |
424 case Cancel_Execution if prover.isDefined => |
422 prover.get.cancel_execution() |
425 prover.get.cancel_execution() |
423 |
426 |
424 case raw @ Session.Raw_Edits(edits) if prover.isDefined => |
427 case raw @ Session.Raw_Edits(edits) if prover.isDefined => |
468 |
471 |
469 /* actions */ |
472 /* actions */ |
470 |
473 |
471 def start(args: List[String]) |
474 def start(args: List[String]) |
472 { |
475 { |
473 global_options += session_actor |
|
474 session_actor ! Start(args) |
476 session_actor ! Start(args) |
475 } |
477 } |
476 |
478 |
477 def stop() |
479 def stop() |
478 { |
480 { |
479 global_options -= session_actor |
|
480 commands_changed_buffer !? Stop |
481 commands_changed_buffer !? Stop |
481 change_parser !? Stop |
482 change_parser !? Stop |
482 session_actor !? Stop |
483 session_actor !? Stop |
483 } |
484 } |
484 |
485 |
485 def cancel_execution() { session_actor ! Cancel_Execution } |
486 def cancel_execution() { session_actor ! Cancel_Execution } |
486 |
487 |
487 def update(edits: List[Document.Edit_Text]) |
488 def update(edits: List[Document.Edit_Text]) |
488 { if (!edits.isEmpty) session_actor !? Session.Raw_Edits(edits) } |
489 { if (!edits.isEmpty) session_actor !? Session.Raw_Edits(edits) } |
489 |
490 |
|
491 def update_options(options: Options) |
|
492 { session_actor !? Update_Options(options) } |
|
493 |
490 def dialog_result(id: Document.ID, serial: Long, result: String) |
494 def dialog_result(id: Document.ID, serial: Long, result: String) |
491 { session_actor ! Session.Dialog_Result(id, serial, result) } |
495 { session_actor ! Session.Dialog_Result(id, serial, result) } |
492 } |
496 } |