Commit graph

1417 commits

Author SHA1 Message Date
Nathaniel Nicandro
7301d6a58c jupyter-org-execute-to-point: Be more aware of the kernel session 2019-03-28 23:29:02 -05:00
Nathaniel Nicandro
580776bf58 Add org-babel-jupyter-src-block-session 2019-03-28 23:29:02 -05:00
Nathaniel Nicandro
5c1643bf77
jupyter-org-jump-to-visible-block: Don't byte compile undefined macro
`avy-with` is a macro that might not be defined at compile time, but at the
same time we do not want to depend on `avy` so we have to ensure that we only
do byte compilation when first loading the function at run time.
2019-03-28 21:55:42 -05:00
Nathaniel Nicandro
c3e67281f1
Add TOC in README 2019-03-28 14:31:17 -05:00
Nathaniel Nicandro
9ff1722293
jupyter-org-with-src-block-client: Macro hygiene 2019-03-27 22:26:26 -05:00
Nathaniel Nicandro
ad5113b9a7
jupyter-start-kernel: Better error reporting during kernel startup
See https://github.com/dzop/emacs-jupyter/issues/70#issuecomment-476940527

* jupyter-kernel-manager.el
(jupyter--kernel-sentinel): Make ignored argument optional.
(jupyter--start-kernel): Don't set the process sentinel.
(jupyter-start-kernel): Report any errors after timeout.
Set the process sentinel as a last step.
2019-03-27 14:34:27 -05:00
Nathaniel Nicandro
4a01e375ae
Update Emacs version used for travis 2019-03-25 14:36:20 -05:00
Nathaniel Nicandro
25975b9fae
Use the right type predicates 2019-03-25 13:19:02 -05:00
Nathaniel Nicandro
2f18192ae7
Remove redundant :execute-input handlers
The `execution-count` slot of a `jupyter-kernel-client` is now updated higher
up in the message handling process which makes these handlers unnecessary.
2019-03-25 13:19:02 -05:00
Nathaniel Nicandro
569ae50214
jupyter-repl-ret: Avoid syncing execution state
There is really no reason for this sync since it happens after checking if the
kernel is busy and the execution-count is now updated whenever an execute_input
message is received in the `jupyter-handle-message` of a
`jupyter-kernel-client`.
2019-03-24 00:11:22 -05:00
Nathaniel Nicandro
a6e476a624
Update a client's execution-count slot on an :execute_input message 2019-03-24 00:11:22 -05:00
Nathaniel Nicandro
67984994a8
jupyter-org-insert-src-block: Consider edge cases when preserving whitespace 2019-03-23 23:33:24 -05:00
Nathaniel Nicandro
7c2e32dfb4
jupyter-org-insert-src-block: Preserve whitespace when inserting src-block 2019-03-23 22:47:40 -05:00
Nathaniel Nicandro
8c11fc0615
jupyter-initialize-connection: Refactor 2019-03-23 18:31:35 -05:00
Nathaniel Nicandro
49a25754da
Update CHANGELOG 2019-03-23 16:24:28 -05:00
Nathaniel Nicandro
c0c8ac7fae
jupyter-start-kernel: Error if no valid kernelspec could be found 2019-03-22 20:10:22 -05:00
Nathaniel Nicandro
ca64ff75c5
jupyter-start-kernel: Cleanup resources on a kernel restart
When a kernel restarts, `jupyter-start-kernel` will overwrite the slots
corresponding to external resources of the old, shutdown, kernel, like the
connection file. Ensure resources are cleaned up before overwriting those
slots.
2019-03-22 20:10:22 -05:00
Nathaniel Nicandro
7ea17ae492
Refactor heartbeat channel
Mainly variable re-naming and in preparation for adding in auto-restart
support.

* `jupyter-hb-consider-dead-periods` -> `jupyter-hb-max-failures`

  * Also convert to a customizable variable

* `kernel-died-cb` -> `dead-cb`
2019-03-22 20:10:22 -05:00
Dan
8004ca188f guard against nil connection file in jupyter-kernel-manager--cleanup (#67) 2019-03-22 18:25:22 -05:00
Nathaniel Nicandro
7fec895c03 Before export, remove ANSI escapes from source block results 2019-03-20 21:08:53 -05:00
Nathaniel Nicandro
3f3db53527 Handle ANSI escape sequences in org-mode src-block results 2019-03-20 21:08:53 -05:00
Nathaniel Nicandro
efeae99131 Add jupyter-ansi-color-apply-on-region 2019-03-20 21:08:53 -05:00
Nathaniel Nicandro
0e8e10babb
jupyter-repl-initialize-fontification: Protect against nil font-lock-defaults 2019-03-20 21:05:46 -05:00
Nathaniel Nicandro
0499e187d0
jupyter-org--define-key-filter: Filter out keys when point is invisible 2019-03-19 13:21:55 -05:00
Nathaniel Nicandro
4ef27c274c
jupyter-tunnel-connection: Consider /docker: TRAMP method
For this case, no tunnels actually need to be created since docker can expose
ports using the -p flag to `docker run`. This is assumed here. A complete
example to start a kernel in a docker container using one of the official
Jupyter docker images is below:

docker pull jupyter/base-notebook
docker run --name test -it --rm -p 56406-56410:56406-56410 \
    jupyter/base-notebook start.sh jupyter-kernel \
       --ip=0.0.0.0 \
       --KernelManager.control_port=56406 \
       --KernelManager.hb_port=56407 \
       --KernelManager.iopub_port=56408 \
       --KernelManager.shell_port=56409 \
       --KernelManager.stdin_port=56410
2019-03-19 00:44:30 -05:00
Nathaniel Nicandro
33bae1762d
org-babel-execute:jupyter: Remove export sync hook before waiting 2019-03-18 10:41:44 -05:00
Nathaniel Nicandro
c010d83696
jupyter-repl-initialize-fontification: Don't fail if functions aren't present 2019-03-17 20:31:25 -05:00
Nathaniel Nicandro
e299a3b3eb
jupyter-code-context (completion): Only consider the deepest nested parenthesis level
This is a better default when considering kernels like Clojupyter.
2019-03-17 20:31:25 -05:00
Nathaniel Nicandro
ffb53244ce jupyter-completion--company-idle-begin: Shorter delay 2019-03-17 02:07:00 -05:00
Nathaniel Nicandro
3b6b60d803 jupyter-org-insert-async-id -> jupyter-org-pending-async-results 2019-03-17 02:06:00 -05:00
Nathaniel Nicandro
cdc826259e jupyter-with-timeout: Don't spin wait so much
`accept-process-output` will return when any output has been read from a
process (after it has been handled by the process filter function) which is
usually the time when we want to check on the wait condition so there is no
need to have such a low time resolution.
2019-03-17 02:05:00 -05:00
Nathaniel Nicandro
c0d13396bb org-babel-execute:jupyter: Make all blocks synchronous during export 2019-03-17 02:04:00 -05:00
Nathaniel Nicandro
129f53f7a8 Add org-babel-jupyter-language-p 2019-03-17 02:03:00 -05:00
Nathaniel Nicandro
3f489d3883 jupyter-org-with-src-block-client: Clarify when BODY is evaluated 2019-03-17 02:02:00 -05:00
Nathaniel Nicandro
5e1e30630b jupyter-handle-message: Properly handle :shutdown-reply
A shutdown-reply message received by a request implies that no other messages
will be received for that request since the kernel will shutdown. Also set
`jupyter-request-idle-received-p` to `t` in such cases.
2019-03-17 02:01:00 -05:00
Nathaniel Nicandro
08d974f4db jupyter-requests-pending-p: Fix issues and add test
* Use `hash-table-count`

* Fix the check on determining how many pending requests there are
2019-03-17 02:00:00 -05:00
Nathaniel Nicandro
3f55bb0def jupyter-test-with-kernel-client: Consider a shutdown kernel 2019-03-17 01:59:00 -05:00
Nathaniel Nicandro
89ab86ca18
jupyter-eval-string: Don't message error when traceback is being shown 2019-03-16 16:34:18 -05:00
Nathaniel Nicandro
52253f4f84
README.org: Add note about Emacs module support 2019-03-16 14:39:28 -05:00
Nathaniel Nicandro
3adf0dc336
Add TODO on supporting ":results link" in org-mode source blocks 2019-03-15 14:41:22 -05:00
Nathaniel Nicandro
e4110ae81b
org-babel-execute:jupyter: Also remove file params in synchronous blocks
See #59.
2019-03-15 14:41:22 -05:00
Nathaniel Nicandro
40624d8930
Simplify quieting of message logging during source block evaluation 2019-03-15 12:53:15 -05:00
Nathaniel Nicandro
26f191a44b
Fix latex fragment toggling 2019-03-15 00:51:47 -05:00
Nathaniel Nicandro
173ec1cfaa
org-babel-jupyter-transform-code (julia): Really fix issues with the :dir argument 2019-03-14 20:04:11 -05:00
Nathaniel Nicandro
4f168bfc47 jupyter-handle-message: Always handle a startup message 2019-03-14 19:57:00 -05:00
Nathaniel Nicandro
1cc29e2ba0 Add jupyter-requests-pending-p 2019-03-14 19:56:00 -05:00
Nathaniel Nicandro
83af335166
Bump version 2019-03-14 09:29:11 -05:00
Nathaniel Nicandro
7e0470c129
Fix indentation 2019-03-14 09:29:11 -05:00
Nathaniel Nicandro
f28d4a5400
Avoid recursive require when loading ob-jupyter
This can happen, e.g. when loading jupyter-org-client.el directly from source
since `org-element` requires `org`.
2019-03-14 09:29:11 -05:00
Nathaniel Nicandro
6a81470be9
jupyter-eval-short-result-display-function: Don't fail when result has '%' characters 2019-03-14 09:16:44 -05:00