* ob-jupyter.el
(org-babel-jupyter--insert-variable-assignments): New function.
(org-babel-prep-session:jupyter, org-babel-load-session:jupyter): Use it.
(org-babel-prep-session:jupyter): Remove DELAY-EVAL argument.
The :file result-parameter of source block interferes with how async result
insertion works, namely how an indicator is inserted to signify that the
results are pending. The parameter is removed in cases where it would
interfere.
* ob-jupyter.el (org-babel-execute:jupyter): Do it.
* jupyter-server.el (jupyter-ioloop, jupyter-server-ioloop): Remove requires.
(jupyter-server): Don't subclass `jupyter-ioloop-comm`.
(jupyter-server--connect-channels, jupyter-server--refresh-comm): Only do
something when the SERVER argument is a `jupyter-comm-layer`, i.e. a
`jupyter-server-ioloop-comm`. We don't check for that class directly since we
would end up requiring ZMQ.
(jupyter-comm-start) [jupyter-server-kernel-manager]: Use the right subclass of
`jupyter-server-abstract-kcomm` depending on if the `jupyter-server` object is
using ZMQ for communication.
(jupyter-server-make-instance): New function. Returns a `jupyter-server`
instance (a `jupyter-server-ioloop-comm`) that uses ZMQ if
`jupyter-server-use-zmq` is non-nil, and a plain old `jupyter-server` instance
otherwise.
(jupyter-current-server): `jupyter-server` -> `jupyter-server-make-instance`.
* ob-jupyter.el (org-babel-jupyter--server-repl): `jupyter-server` ->
`jupyter-server-make-instance`.
* test/test-helper.el (jupyter-test-with-notebook): `jupyter-server` ->
`jupyter-server-make-instance`.
* README.org: Add notes on behavior when a kernel's language name has spaces
and uppercase characters.
* jupyter-base.el (jupyter-canonicalize-language-string): New function.
* jupyter-client.el (jupyter-kernel-info): Use it.
* jupyter-kernelspec.el (jupyter-available-kernelspecs): Use it.
* ob-jupyter.el (org-babel-jupyter-aliases-from-kernelspecs): Use it.
* test/jupyter-test.el (jupyter-canonicalize-language-string): New test.
`jupyter-wait-until-idle` can return immediately if an idle message has already
been received, but the function `jupyter-wait-until` will eventually raise an
error in that case. Avoid the error by checking
`jupyter-request-idle-received-p` before calling `jupyter-wait-until`.
* jupyter-client.el (jupyter-wait-until-idle): Do it.
* ob-jupyter.el (org-babel-execute:jupyter): Account for changes in
`jupyter-wait-until-idle`.
This is needed because `org-mode` merges many sources of source block params so
its not enough to just re-compute the parameters in `jupyter-generate-request`
using `org-babel-get-src-block-info` or `org-babel-log-get-info`.
* ob-jupyter.el (org-babel-jupyter--server-repl): Do it.
(org-babel-jupyter-make-language-alias): Set `org-babel-tangle-lang-exts` and
`org-src-lang-modes` also.
(org-babel-jupyter-aliases-from-kernelspecs): Accept an optional `specs`
argument. Move setting of `org-babel-tangle-lang-exts` and `org-src-lang-modes`
to `org-babel-jupyter-make-language-alias`.
The normal way of loading `ob-jupyter` is through `org-babel-do-load-languages`
so a users `exec-path` should be enabled by that time and so there is a higher
chance that it is setup correctly. See #151.
* jupyter-org-client.el (jupyter-org-request-at-point): Do it.
(org-babel-jupyter-src-block-session): New declare.
* ob-jupyter.el (org-babel-jupyter-session-clients): Add doc about keys.
* test/jupyter-test.el (jupyter-org-request-at-point): New test.
* jupyter-env.el (jupyter-runtime-directory): Remove custom status.
New function definition.
* jupyter-kernel-manager.el (jupyter-write-connection-file):
Use new function.
* ob-jupyter.el (org-babel-jupyter--run-repl):
Remove setting of `jupyter-runtime-directory`.
* test/jupyter-test.el (jupyter-runtime-directory): New test.
Fixes#137
* jupyter-base.el (jupyter-kernelspec): Un-require.
(jupyter-command, jupyter-locate-python)
(jupyter-runtime-directory): Move to new file `jupyter-env.el`
(jupyter-include-other-output, jupyter-iopub-message-hook)
(jupyter-shell-message-hook)
(jupyter-stdin-message-hook): Move to `jupyter-client.el`
(jupyter-sha256, jupyter-hmac-sha256):
(jupytern-new-uuid): Move to `jupyter-messages.el`. Add declaration of
`jupyter-new-uuid` to account for its removal.
(jupyter-create-connection-info)
(jupyter-write-connection-file): Move to `jupyter-kernel-manager.el`
(jupyter-connect-endpoint, jupyter-connect-channel): Move to `jupyter-channels.el`
* jupyter-channels.el: Accept moved functions.
* jupyter-client.el: Accept moved variables.
* jupyter-kernel-manager.el: Accept moved functions.
(jupyter-env, jupyter-kernelspec): New requires.
* jupyter-kernelspec (jupyter-env): New require.
(jupyter-command): Remove declaration.
(jupyter-read-plist-from-string): New declaration.
* jupyter-messages.el: Accept moved functions.
(hmac-def, json): New requires.
* jupyter-org-extensions.el (jupyter-kernelspec): New require.
* jupyter-repl.el (jupyter-kernelspec): New require.
* jupyter-env.el: New file.
* ob-jupyter.el (jupyter-env, jupyter-kernelspec): New requires.
* test/jupyter-test.el (jupyter-env): New require.
This avoids a bug in `org-mode`. Although the documentation of
`org-src-lang-modes` says the mode can be a symbol or a string, the
customization type only specifies symbol so having a string causes errors when
`custom-initialize-reset` is called after
`org-babel-jupyter-aliases-from-kernelspecs`.
For assoc lang org-src-lang-modes may return symbol sh, (inter 'sh) will
return an error.
For some languages like C++, the corresponding language mode shall be c++