src/Pure/System/session.scala
author wenzelm
Fri Aug 26 22:14:12 2011 +0200 (2011-08-26 ago)
changeset 44484 470f2ee5950e
parent 44481 bb42bc831570
child 44573 51f8895b9ad9
permissions -rw-r--r--
tuned Session.edit_node: update_perspective based on last_exec_offset;
wenzelm@36676
     1
/*  Title:      Pure/System/session.scala
wenzelm@36676
     2
    Author:     Makarius
wenzelm@38221
     3
    Options:    :folding=explicit:collapseFolds=1:
wenzelm@36676
     4
wenzelm@43651
     5
Main Isabelle/Scala session, potentially with running prover process.
wenzelm@36676
     6
*/
wenzelm@34777
     7
wenzelm@34871
     8
package isabelle
wenzelm@34777
     9
wenzelm@43520
    10
import java.lang.System
wenzelm@34777
    11
wenzelm@34820
    12
import scala.actors.TIMEOUT
wenzelm@38226
    13
import scala.actors.Actor
wenzelm@34777
    14
import scala.actors.Actor._
wenzelm@34777
    15
wenzelm@34815
    16
wenzelm@34791
    17
object Session
wenzelm@34791
    18
{
wenzelm@43716
    19
  /* file store */
wenzelm@43645
    20
wenzelm@43645
    21
  abstract class File_Store
wenzelm@43645
    22
  {
wenzelm@44163
    23
    def append(master_dir: String, path: Path): String
wenzelm@44163
    24
    def require(file: String): Unit
wenzelm@43645
    25
  }
wenzelm@43645
    26
wenzelm@43645
    27
wenzelm@34813
    28
  /* events */
wenzelm@34813
    29
wenzelm@43716
    30
  //{{{
wenzelm@34791
    31
  case object Global_Settings
wenzelm@37849
    32
  case object Perspective
wenzelm@38849
    33
  case object Assignment
wenzelm@38360
    34
  case class Commands_Changed(set: Set[Command])
wenzelm@39630
    35
wenzelm@39630
    36
  sealed abstract class Phase
wenzelm@39630
    37
  case object Inactive extends Phase
wenzelm@39701
    38
  case object Startup extends Phase  // transient
wenzelm@39701
    39
  case object Failed extends Phase
wenzelm@39630
    40
  case object Ready extends Phase
wenzelm@39701
    41
  case object Shutdown extends Phase  // transient
wenzelm@43716
    42
  //}}}
wenzelm@34791
    43
}
wenzelm@34791
    44
wenzelm@34777
    45
wenzelm@43661
    46
class Session(val file_store: Session.File_Store)
wenzelm@34777
    47
{
wenzelm@37849
    48
  /* real time parameters */  // FIXME properties or settings (!?)
wenzelm@37849
    49
wenzelm@43716
    50
  val input_delay = Time.seconds(0.3)  // user input (e.g. text edits, cursor movement)
wenzelm@43716
    51
  val output_delay = Time.seconds(0.1)  // prover output (markup, common messages)
wenzelm@43716
    52
  val update_delay = Time.seconds(0.5)  // GUI layout updates
wenzelm@37849
    53
wenzelm@37849
    54
wenzelm@34809
    55
  /* pervasive event buses */
wenzelm@34809
    56
wenzelm@34809
    57
  val global_settings = new Event_Bus[Session.Global_Settings.type]
wenzelm@37849
    58
  val perspective = new Event_Bus[Session.Perspective.type]
wenzelm@38849
    59
  val assignments = new Event_Bus[Session.Assignment.type]
wenzelm@43716
    60
  val commands_changed = new Event_Bus[Session.Commands_Changed]
wenzelm@43716
    61
  val phase_changed = new Event_Bus[Session.Phase]
wenzelm@43721
    62
  val raw_messages = new Event_Bus[Isabelle_Process.Message]
wenzelm@43716
    63
wenzelm@34809
    64
wenzelm@34809
    65
wenzelm@38841
    66
  /** buffered command changes (delay_first discipline) **/
wenzelm@38841
    67
wenzelm@43716
    68
  //{{{
wenzelm@38841
    69
  private case object Stop
wenzelm@38841
    70
wenzelm@39572
    71
  private val (_, command_change_buffer) =
wenzelm@39572
    72
    Simple_Thread.actor("command_change_buffer", daemon = true)
wenzelm@38841
    73
  {
wenzelm@38841
    74
    var changed: Set[Command] = Set()
wenzelm@38841
    75
    var flush_time: Option[Long] = None
wenzelm@38841
    76
wenzelm@38841
    77
    def flush_timeout: Long =
wenzelm@38841
    78
      flush_time match {
wenzelm@38841
    79
        case None => 5000L
wenzelm@40848
    80
        case Some(time) => (time - System.currentTimeMillis()) max 0
wenzelm@38841
    81
      }
wenzelm@38841
    82
wenzelm@38841
    83
    def flush()
wenzelm@38841
    84
    {
wenzelm@38841
    85
      if (!changed.isEmpty) commands_changed.event(Session.Commands_Changed(changed))
wenzelm@38841
    86
      changed = Set()
wenzelm@38841
    87
      flush_time = None
wenzelm@38841
    88
    }
wenzelm@38841
    89
wenzelm@38841
    90
    def invoke()
wenzelm@38841
    91
    {
wenzelm@40848
    92
      val now = System.currentTimeMillis()
wenzelm@38841
    93
      flush_time match {
wenzelm@40848
    94
        case None => flush_time = Some(now + output_delay.ms)
wenzelm@38841
    95
        case Some(time) => if (now >= time) flush()
wenzelm@38841
    96
      }
wenzelm@38841
    97
    }
wenzelm@38841
    98
wenzelm@38841
    99
    var finished = false
wenzelm@38841
   100
    while (!finished) {
wenzelm@38841
   101
      receiveWithin(flush_timeout) {
wenzelm@38841
   102
        case command: Command => changed += command; invoke()
wenzelm@38841
   103
        case TIMEOUT => flush()
wenzelm@39630
   104
        case Stop => finished = true; reply(())
wenzelm@38841
   105
        case bad => System.err.println("command_change_buffer: ignoring bad message " + bad)
wenzelm@38841
   106
      }
wenzelm@38841
   107
    }
wenzelm@38841
   108
  }
wenzelm@38841
   109
  //}}}
wenzelm@38841
   110
wenzelm@38841
   111
wenzelm@38841
   112
wenzelm@38841
   113
  /** main protocol actor **/
wenzelm@34809
   114
wenzelm@43651
   115
  /* global state */
wenzelm@43644
   116
wenzelm@43716
   117
  @volatile var verbose: Boolean = false
wenzelm@43716
   118
wenzelm@43716
   119
  @volatile private var loaded_theories: Set[String] = Set()
wenzelm@43673
   120
wenzelm@43695
   121
  @volatile private var syntax = new Outer_Syntax
wenzelm@38569
   122
  def current_syntax(): Outer_Syntax = syntax
wenzelm@34809
   123
wenzelm@39626
   124
  @volatile private var reverse_syslog = List[XML.Elem]()
wenzelm@39629
   125
  def syslog(): String = reverse_syslog.reverse.map(msg => XML.content(msg).mkString).mkString("\n")
wenzelm@39626
   126
wenzelm@39630
   127
  @volatile private var _phase: Session.Phase = Session.Inactive
wenzelm@39633
   128
  private def phase_=(new_phase: Session.Phase)
wenzelm@39630
   129
  {
wenzelm@39630
   130
    _phase = new_phase
wenzelm@39701
   131
    phase_changed.event(new_phase)
wenzelm@39630
   132
  }
wenzelm@43716
   133
  def phase = _phase
wenzelm@43553
   134
  def is_ready: Boolean = phase == Session.Ready
wenzelm@39630
   135
wenzelm@38841
   136
  private val global_state = new Volatile(Document.State.init)
wenzelm@43719
   137
  def current_state(): Document.State = global_state()
wenzelm@34816
   138
wenzelm@43716
   139
  def snapshot(name: String, pending_edits: List[Text.Edit]): Document.Snapshot =
wenzelm@43719
   140
    global_state().snapshot(name, pending_edits)
wenzelm@43716
   141
wenzelm@43651
   142
wenzelm@43651
   143
  /* theory files */
wenzelm@43651
   144
wenzelm@43651
   145
  val thy_load = new Thy_Load
wenzelm@43651
   146
  {
wenzelm@43673
   147
    override def is_loaded(name: String): Boolean =
wenzelm@43673
   148
      loaded_theories.contains(name)
wenzelm@43673
   149
wenzelm@44159
   150
    override def check_thy(dir: Path, name: String): (String, Thy_Header) =
wenzelm@43651
   151
    {
wenzelm@43661
   152
      val file = Isabelle_System.platform_file(dir + Thy_Header.thy_path(name))
wenzelm@43652
   153
      if (!file.exists || !file.isFile) error("No such file: " + quote(file.toString))
wenzelm@43651
   154
      val text = Standard_System.read_file(file)
wenzelm@43661
   155
      val header = Thy_Header.read(text)
wenzelm@43651
   156
      (text, header)
wenzelm@43651
   157
    }
wenzelm@43651
   158
  }
wenzelm@43651
   159
wenzelm@43651
   160
  val thy_info = new Thy_Info(thy_load)
wenzelm@43651
   161
wenzelm@44442
   162
  def header_edit(name: String, master_dir: String,
wenzelm@44442
   163
    header: Document.Node_Header): Document.Edit_Text =
wenzelm@44442
   164
  {
wenzelm@44442
   165
    def norm_import(s: String): String =
wenzelm@44442
   166
    {
wenzelm@44442
   167
      val thy_name = Thy_Header.base_name(s)
wenzelm@44442
   168
      if (thy_load.is_loaded(thy_name)) thy_name
wenzelm@44442
   169
      else file_store.append(master_dir, Thy_Header.thy_path(Path.explode(s)))
wenzelm@44442
   170
    }
wenzelm@44442
   171
    def norm_use(s: String): String =
wenzelm@44442
   172
      file_store.append(master_dir, Path.explode(s))
wenzelm@44442
   173
wenzelm@44442
   174
    val header1: Document.Node_Header =
wenzelm@44442
   175
      header match {
wenzelm@44442
   176
        case Exn.Res(Thy_Header(thy_name, _, _))
wenzelm@44442
   177
        if (thy_load.is_loaded(thy_name)) =>
wenzelm@44442
   178
          Exn.Exn(ERROR("Attempt to update loaded theory " + quote(thy_name)))
wenzelm@44442
   179
        case _ => Document.Node.norm_header(norm_import, norm_use, header)
wenzelm@44442
   180
      }
wenzelm@44442
   181
    (name, Document.Node.Header(header1))
wenzelm@44442
   182
  }
wenzelm@44442
   183
wenzelm@43651
   184
wenzelm@43651
   185
  /* actor messages */
wenzelm@43651
   186
wenzelm@43716
   187
  private case class Start(timeout: Time, args: List[String])
wenzelm@43716
   188
  private case object Interrupt
wenzelm@44385
   189
  private case class Init_Node(name: String, master_dir: String,
wenzelm@44385
   190
    header: Document.Node_Header, perspective: Text.Perspective, text: String)
wenzelm@44385
   191
  private case class Edit_Node(name: String, master_dir: String,
wenzelm@44385
   192
    header: Document.Node_Header, perspective: Text.Perspective, edits: List[Text.Edit])
wenzelm@43722
   193
  private case class Change_Node(
wenzelm@43722
   194
    name: String,
wenzelm@43722
   195
    doc_edits: List[Document.Edit_Command],
wenzelm@43722
   196
    previous: Document.Version,
wenzelm@43722
   197
    version: Document.Version)
wenzelm@41534
   198
wenzelm@39572
   199
  private val (_, session_actor) = Simple_Thread.actor("session_actor", daemon = true)
wenzelm@38639
   200
  {
wenzelm@43648
   201
    val this_actor = self
wenzelm@43649
   202
    var prover: Option[Isabelle_Process with Isar_Document] = None
wenzelm@34809
   203
wenzelm@34809
   204
wenzelm@44436
   205
    /* perspective */
wenzelm@44436
   206
wenzelm@44436
   207
    def update_perspective(name: String, text_perspective: Text.Perspective)
wenzelm@44436
   208
    {
wenzelm@44475
   209
      val previous = global_state().tip_version
wenzelm@44436
   210
      val (perspective, version) = Thy_Syntax.edit_perspective(previous, name, text_perspective)
wenzelm@44436
   211
wenzelm@44436
   212
      val text_edits: List[Document.Edit_Text] =
wenzelm@44436
   213
        List((name, Document.Node.Perspective(text_perspective)))
wenzelm@44436
   214
      val change =
wenzelm@44436
   215
        global_state.change_yield(
wenzelm@44446
   216
          _.continue_history(Future.value(previous), text_edits, Future.value(version)))
wenzelm@44436
   217
wenzelm@44477
   218
      val assignment = global_state().the_assignment(previous).check_finished
wenzelm@44479
   219
      global_state.change(_.define_version(version, assignment))
wenzelm@44476
   220
      global_state.change_yield(_.assign(version.id, Document.no_assign))
wenzelm@44436
   221
wenzelm@44436
   222
      prover.get.update_perspective(previous.id, version.id, name, perspective)
wenzelm@44436
   223
    }
wenzelm@44436
   224
wenzelm@44436
   225
wenzelm@43716
   226
    /* incoming edits */
wenzelm@43716
   227
wenzelm@44182
   228
    def handle_edits(name: String, master_dir: String,
wenzelm@44384
   229
        header: Document.Node_Header, edits: List[Document.Node.Edit[Text.Edit, Text.Perspective]])
wenzelm@43716
   230
    //{{{
wenzelm@43716
   231
    {
wenzelm@43716
   232
      val syntax = current_syntax()
wenzelm@43719
   233
      val previous = global_state().history.tip.version
wenzelm@44185
   234
wenzelm@44442
   235
      val text_edits = header_edit(name, master_dir, header) :: edits.map(edit => (name, edit))
wenzelm@44185
   236
      val result = Future.fork { Thy_Syntax.text_edits(syntax, previous.join, text_edits) }
wenzelm@43722
   237
      val change =
wenzelm@44446
   238
        global_state.change_yield(_.continue_history(previous, text_edits, result.map(_._2)))
wenzelm@43716
   239
wenzelm@43722
   240
      result.map {
wenzelm@44157
   241
        case (doc_edits, _) =>
wenzelm@43722
   242
          assignments.await { global_state().is_assigned(previous.get_finished) }
wenzelm@44157
   243
          this_actor ! Change_Node(name, doc_edits, previous.join, change.version.join)
wenzelm@43722
   244
      }
wenzelm@43716
   245
    }
wenzelm@43716
   246
    //}}}
wenzelm@43716
   247
wenzelm@43716
   248
wenzelm@44436
   249
    /* exec state assignment */
wenzelm@44436
   250
wenzelm@44476
   251
    def handle_assign(id: Document.Version_ID, assign: Document.Assign)
wenzelm@44436
   252
    //{{{
wenzelm@44436
   253
    {
wenzelm@44476
   254
      val cmds = global_state.change_yield(_.assign(id, assign))
wenzelm@44436
   255
      for (cmd <- cmds) command_change_buffer ! cmd
wenzelm@44436
   256
      assignments.event(Session.Assignment)
wenzelm@44436
   257
    }
wenzelm@44436
   258
    //}}}
wenzelm@44436
   259
wenzelm@44436
   260
wenzelm@43716
   261
    /* resulting changes */
wenzelm@34809
   262
wenzelm@43722
   263
    def handle_change(change: Change_Node)
wenzelm@38221
   264
    //{{{
wenzelm@34809
   265
    {
wenzelm@43722
   266
      val previous = change.previous
wenzelm@43722
   267
      val version = change.version
wenzelm@43722
   268
      val name = change.name
wenzelm@43722
   269
      val doc_edits = change.doc_edits
wenzelm@38366
   270
wenzelm@44383
   271
      def id_command(command: Command)
wenzelm@43720
   272
      {
wenzelm@43720
   273
        if (global_state().lookup_command(command.id).isEmpty) {
wenzelm@43720
   274
          global_state.change(_.define_command(command))
wenzelm@43720
   275
          prover.get.define_command(command.id, Symbol.encode(command.source))
wenzelm@43720
   276
        }
wenzelm@43720
   277
      }
wenzelm@44383
   278
      doc_edits foreach {
wenzelm@44383
   279
        case (_, edit) =>
wenzelm@44383
   280
          edit foreach { case (c1, c2) => c1 foreach id_command; c2 foreach id_command }
wenzelm@44383
   281
      }
wenzelm@43722
   282
wenzelm@44479
   283
      val assignment = global_state().the_assignment(previous).check_finished
wenzelm@44479
   284
      global_state.change(_.define_version(version, assignment))
wenzelm@44481
   285
      prover.get.update(previous.id, version.id, doc_edits)
wenzelm@34809
   286
    }
wenzelm@38221
   287
    //}}}
wenzelm@34809
   288
wenzelm@34809
   289
wenzelm@34809
   290
    /* prover results */
wenzelm@34809
   291
wenzelm@34809
   292
    def handle_result(result: Isabelle_Process.Result)
wenzelm@38221
   293
    //{{{
wenzelm@34809
   294
    {
wenzelm@43716
   295
      def bad_result(result: Isabelle_Process.Result)
wenzelm@43716
   296
      {
wenzelm@43716
   297
        if (verbose)
wenzelm@43716
   298
          System.err.println("Ignoring prover result: " + result.message.toString)
wenzelm@43716
   299
      }
wenzelm@43716
   300
wenzelm@38722
   301
      result.properties match {
wenzelm@43748
   302
        case Position.Id(state_id) if !result.is_raw =>
wenzelm@38370
   303
          try {
wenzelm@38841
   304
            val st = global_state.change_yield(_.accumulate(state_id, result.message))
wenzelm@38841
   305
            command_change_buffer ! st.command
wenzelm@38370
   306
          }
wenzelm@43748
   307
          catch {
wenzelm@43748
   308
            case _: Document.State.Fail => bad_result(result)
wenzelm@43748
   309
          }
wenzelm@43748
   310
        case Markup.Invoke_Scala(name, id) if result.is_raw =>
wenzelm@43748
   311
          Future.fork {
wenzelm@43748
   312
            val arg = XML.content(result.body).mkString
wenzelm@43748
   313
            val (tag, res) = Invoke_Scala.method(name, arg)
wenzelm@43748
   314
            prover.get.invoke_scala(id, tag, res)
wenzelm@43748
   315
          }
wenzelm@44298
   316
        case Markup.Cancel_Scala(id) =>
wenzelm@44298
   317
          System.err.println("cancel_scala " + id)  // FIXME cancel JVM task
wenzelm@38722
   318
        case _ =>
wenzelm@39630
   319
          if (result.is_syslog) {
wenzelm@39630
   320
            reverse_syslog ::= result.message
wenzelm@40533
   321
            if (result.is_ready) {
wenzelm@43716
   322
              // FIXME move to ML side (!?)
wenzelm@40533
   323
              syntax += ("hence", Keyword.PRF_ASM_GOAL, "then have")
wenzelm@40533
   324
              syntax += ("thus", Keyword.PRF_ASM_GOAL, "then show")
wenzelm@40533
   325
              phase = Session.Ready
wenzelm@40533
   326
            }
wenzelm@39701
   327
            else if (result.is_exit && phase == Session.Startup) phase = Session.Failed
wenzelm@39696
   328
            else if (result.is_exit) phase = Session.Inactive
wenzelm@39630
   329
          }
wenzelm@39626
   330
          else if (result.is_stdout) { }
wenzelm@39625
   331
          else if (result.is_status) {
wenzelm@38370
   332
            result.body match {
wenzelm@44476
   333
              case List(Isar_Document.Assign(id, assign)) =>
wenzelm@44476
   334
                try { handle_assign(id, assign) }
wenzelm@38414
   335
                catch { case _: Document.State.Fail => bad_result(result) }
wenzelm@38370
   336
              case List(Keyword.Command_Decl(name, kind)) => syntax += (name, kind)
wenzelm@38370
   337
              case List(Keyword.Keyword_Decl(name)) => syntax += name
wenzelm@43673
   338
              case List(Thy_Info.Loaded_Theory(name)) => loaded_theories += name
wenzelm@39625
   339
              case _ => bad_result(result)
wenzelm@38370
   340
            }
wenzelm@38370
   341
          }
wenzelm@39625
   342
          else bad_result(result)
wenzelm@43748
   343
      }
wenzelm@34809
   344
    }
wenzelm@38221
   345
    //}}}
wenzelm@34809
   346
wenzelm@34820
   347
wenzelm@39630
   348
    /* main loop */
wenzelm@34809
   349
wenzelm@43716
   350
    //{{{
wenzelm@38639
   351
    var finished = false
wenzelm@38639
   352
    while (!finished) {
wenzelm@38639
   353
      receive {
wenzelm@43649
   354
        case Start(timeout, args) if prover.isEmpty =>
wenzelm@39701
   355
          if (phase == Session.Inactive || phase == Session.Failed) {
wenzelm@39701
   356
            phase = Session.Startup
wenzelm@43661
   357
            prover = Some(new Isabelle_Process(timeout, this_actor, args:_*) with Isar_Document)
wenzelm@39701
   358
          }
wenzelm@38841
   359
wenzelm@39701
   360
        case Stop =>
wenzelm@39701
   361
          if (phase == Session.Ready) {
wenzelm@39701
   362
            global_state.change(_ => Document.State.init)  // FIXME event bus!?
wenzelm@39701
   363
            phase = Session.Shutdown
wenzelm@43649
   364
            prover.get.terminate
wenzelm@43717
   365
            prover = None
wenzelm@39701
   366
            phase = Session.Inactive
wenzelm@39701
   367
          }
wenzelm@39630
   368
          finished = true
wenzelm@39630
   369
          reply(())
wenzelm@38850
   370
wenzelm@43717
   371
        case Interrupt if prover.isDefined =>
wenzelm@43717
   372
          prover.get.interrupt
wenzelm@43716
   373
wenzelm@44385
   374
        case Init_Node(name, master_dir, header, perspective, text) if prover.isDefined =>
wenzelm@43716
   375
          // FIXME compare with existing node
wenzelm@44182
   376
          handle_edits(name, master_dir, header,
wenzelm@44385
   377
            List(Document.Node.Clear(),
wenzelm@44385
   378
              Document.Node.Edits(List(Text.Edit.insert(0, text))),
wenzelm@44385
   379
              Document.Node.Perspective(perspective)))
wenzelm@43716
   380
          reply(())
wenzelm@43716
   381
wenzelm@44385
   382
        case Edit_Node(name, master_dir, header, perspective, text_edits) if prover.isDefined =>
wenzelm@44484
   383
          if (text_edits.isEmpty && global_state().tip_stable &&
wenzelm@44484
   384
              perspective.range.stop <= global_state().last_exec_offset(name))
wenzelm@44484
   385
            update_perspective(name, perspective)
wenzelm@44484
   386
          else
wenzelm@44436
   387
            handle_edits(name, master_dir, header,
wenzelm@44436
   388
              List(Document.Node.Edits(text_edits), Document.Node.Perspective(perspective)))
wenzelm@43718
   389
          reply(())
wenzelm@43718
   390
wenzelm@43722
   391
        case change: Change_Node if prover.isDefined =>
wenzelm@43722
   392
          handle_change(change)
wenzelm@43716
   393
wenzelm@43721
   394
        case input: Isabelle_Process.Input =>
wenzelm@43721
   395
          raw_messages.event(input)
wenzelm@43721
   396
wenzelm@43716
   397
        case result: Isabelle_Process.Result =>
wenzelm@43716
   398
          handle_result(result)
wenzelm@43721
   399
          raw_messages.event(result)
wenzelm@43716
   400
wenzelm@43717
   401
        case bad => System.err.println("session_actor: ignoring bad message " + bad)
wenzelm@34777
   402
      }
wenzelm@34777
   403
    }
wenzelm@43716
   404
    //}}}
wenzelm@34777
   405
  }
wenzelm@34777
   406
wenzelm@34809
   407
wenzelm@43716
   408
  /* actions */
wenzelm@34809
   409
wenzelm@40848
   410
  def start(timeout: Time, args: List[String]) { session_actor ! Start(timeout, args) }
wenzelm@34820
   411
wenzelm@39630
   412
  def stop() { command_change_buffer !? Stop; session_actor !? Stop }
wenzelm@38841
   413
wenzelm@43716
   414
  def interrupt() { session_actor ! Interrupt }
wenzelm@43648
   415
wenzelm@44385
   416
  // FIXME simplify signature
wenzelm@44385
   417
  def init_node(name: String, master_dir: String,
wenzelm@44385
   418
    header: Document.Node_Header, perspective: Text.Perspective, text: String)
wenzelm@44385
   419
  { session_actor !? Init_Node(name, master_dir, header, perspective, text) }
wenzelm@38221
   420
wenzelm@44385
   421
  // FIXME simplify signature
wenzelm@44385
   422
  def edit_node(name: String, master_dir: String, header: Document.Node_Header,
wenzelm@44385
   423
    perspective: Text.Perspective, edits: List[Text.Edit])
wenzelm@44385
   424
  { session_actor !? Edit_Node(name, master_dir, header, perspective, edits) }
wenzelm@34777
   425
}