Messages were queued by the messages sent timestamp in the message header as
well as based on the channel the message was received on because there is no
guarantee on the order of the received messages. This matters because a request
is dropped from a client's request table when an idle message is received, but
this idle message is not guaranteed to be the last message received for a
request, for example a reply message may come after the idle message has been
received.
Now if a request has received an idle message already, instead of
dropping it immediately, drop it only when the last received message time for
the request is longer than a few seconds.
Handler methods are only run on a successful request. If an error occurs during
execution an error message is emitted on the IOPub channel, this is where
errors are handled. Or they can be captured in the reply messages through
callbacks.
This allows the REPL client to preserve the execution state of the kernel
while `org-babel-execute:jupyter` takes care of all of the output generated by
the kernel without having to preserve the state of the REPL.
`jupyter-inhibit-handlers` can now be a list of message types. If a message is
received and has one of these message types, then the client handler
corresponding to that message type is prevented from running.
When the cell code initially does not contain a history element and you would
like to navigate backward in history, the previous behavior did not take into
account the N argument of `jupyter-repl-history-previous` in this case.
The new behavior does.
Setup the necessary hooks before starting the kernel so that we can ensure that
the startup message is caught.
A short delay is also added whenever we start a channel. This was necessary for
the client to catch the startup message of a python kernel.
- Return the correct result when HTML contains only image data
- Still need to handle all possible cases of the data URL scheme
- Add `org-babel-jupyter--image-result`