* Use the `target-name` argument in `jupyter-handle-comm-open`
* Remove hard-coded URL format and use the new variable
`jupyter-widgets-url-format` instead
* Add `jupyter-widgets-supported-targets` to explicitly state which widget
targets are supported
* Rename `widget-proc` to `widget-sock` in a `jupyter-widget-client`
* Initialize the widget socket only when opening a valid comm
* Previously it was initialized when the client was initialized, but a client
may not even create any widgets so the widget socket would be unused.
* Use `pcase` in `jupyter-widgets-on-message`
* Update documentation and commentary of `jupyter-widget-client`
- Be more obvious in `jupyter-repl-ret`
- Prefer shorter lines in `js/emacs-jupyter.js`
- Add `jupyter-repl-language`
- Refactor `jupyter-handle-error` for `jupyter-repl-client's
- Include margin width when fixing traceback spacing for python kernels
- Extract out special handling of python kernels in `jupyter-handle-error`
This introduces a way of keeping track of both the encoded and decoded parts of
a message, only decoding the parts of a message when needed, and only encoding
the parts of a message when needed.
If the objects passed to `jupyter--encode` or `jupyter--decode` are lists with
the first element being the symbol `message-part`, then the second element of
the list is interpreted as being the encoded message and the third element
being the decoded part of the message. If either the encoded or the decoded
part are nil, then `jupyter--encode` or `jupyter--decode` will fill those
message parts in and on subsequent calls, passing in the same list, no work
will need to be performed.
This avoids double encoding messages when relaying messages between the channel
subprocess and the browser displaying widgets. This speeds up the communication
process. The cost is storing two representations of the same message, i.e.
speed vs memory.
Fixes:
- Use `eq` instead of `equal` in message status predicates
- Fix time string decoding
- `parse-time-string` was returning all nil on Emacs 26
- Include validation for parent header in `jupyter--encode-message`
- Use `jupyter-message-header' to access the message header instead of `plist-get`
- Add missing namespace to sha256 function
- Any function defined should have a `jupyter-` prefix
- Remove `cl-lib` dependency in `jupyter-messages.el`
- Include `subr-x` in `jupyter-base.el`
- Use `tramp-file-name-user` instead of `tramp-file-name-real-user` since the
latter is missing in Emacs 26
- Allow specifying a msg-id before a call to `jupyter-send`
- This avoid sending a message to the browser displaying the widgets on every
message send to the kernel. The previous implementation generated a new ID
without allowing the caller to pass one in.
- Simplify message polling by sending received messages from the kernel to the
parent Emacs process at the moment of arrival.
- Strip extra prefix from completion matches if necessary
- The python kernel returns matches like foo.bar.baz, but we just want to
show the baz part as a completion.
- Prevent completion after '.' in floating point numbers
- Note this may be undesirable since numbers are just objects in many
languages and thus have methods associated with them.
- Remove unused no-cache and match cases in `company-jupyter-repl`