• João Távora's avatar
    Improve channel teardown for sly-mrepl · 7df61bfe
    João Távora authored
    * sly.el (sly-dispatch-event): Group channel-related
    events. Accept new `:invalid-channel' event.
    (sly-close-channel): Improve error message.
    
    * swank.lisp (:swank): Export SWANK:STOP-PROCESSING symbol.
    (process-requests): Catch SWANK:STOP-PROCESSING tag.
    (thread-for-evaluation): Shoosh compilers.
    (dispatch-event): Handle invalid channels.
    (close-channel): New function.
    (channel-send): Document generic.
    
    * contrib/sly-mrepl.el (sly-mrepl-mode): Don't add to `kill-buffer-hook' here.
    (sly-mrepl-new): Rather here when we're sure to have a remote channel.
    (sly-mrepl--delete-process): Delete it.
    (sly-mrepl--teardown): Delete process, teardown remote, close local.
    
    * contrib/swank-mrepl.lisp (:compile-toplevel): import SWANK:CLOSE-CHANNEL
    and SWANK:STOP-PROCESSING.
    (listener-channel): Use accessors.
    (initialize-instance): Fix whitespace.
    (create-mrepl): Give channel a name
    (drop-unprocessed-events): Add docstring.
    (spawn-listener-thread): Learn to teardown thread.
    (:teardown): New channel method.
    (mrepl-eval): Rewrite env-setting for clarity.
    7df61bfe