Commit graph

512 commits

Author SHA1 Message Date
Nathaniel Nicandro
15503e1846 More fine tuned syntactic fontification 2018-05-15 16:45:22 -05:00
Nathaniel Nicandro
4c04436feb Really prevent insertion of text in a finalized cell 2018-05-15 16:45:18 -05:00
Nathaniel Nicandro
d9e38faf35 Markdown links for the Julia kernel are clickable 2018-05-13 12:11:14 -05:00
Nathaniel Nicandro
bcd45b6db4 Tiny refactors/optimizations 2018-05-13 12:11:08 -05:00
Nathaniel Nicandro
c65a842b45 Add org-babel-jupyter-scratch-buffer 2018-05-13 12:11:07 -05:00
Nathaniel Nicandro
6fec4e2d85 Implement jupyter-repl-scratch-buffer 2018-05-06 03:18:05 -05:00
Nathaniel Nicandro
53ebf1ad35 Ensure a unibyte representation when signing messages 2018-05-06 03:16:47 -05:00
Nathaniel Nicandro
f79c0b68ac Update ZMQ calls for an updated version of ZMQ 2018-05-06 03:15:42 -05:00
Nathaniel Nicandro
9ddec6c469 Decode date fields into time objects in jupyter--decode 2018-05-05 23:16:01 -05:00
Nathaniel Nicandro
979cac9848 Handle :results none 2018-04-19 01:43:41 -05:00
Nathaniel Nicandro
35d8dfa125 Add jupyter image for ob-jupyter tests 2018-02-12 18:04:20 -06:00
Nathaniel Nicandro
b1ec67645e Ignore temporary flycheck files 2018-02-12 18:03:21 -06:00
Nathaniel Nicandro
ef69521202 Update documentation and comments 2018-02-12 11:06:09 -06:00
Nathaniel Nicandro
32bee0bd67 Fix REPL callbacks to take into account the REPL's status handler
The status handler should only run for execute requests and should be
 inhibited for other kinds of requests.
2018-02-12 10:58:36 -06:00
Nathaniel Nicandro
c4a1d6aa97 Remove old variable 2018-02-12 10:57:45 -06:00
Nathaniel Nicandro
09534ab6fb Don't error out in a predicate, just return nil 2018-02-12 10:57:19 -06:00
Nathaniel Nicandro
26544b95ca Refactor jupyter-repl-ret to (hopefully) be more obvious in what its doing 2018-02-12 10:55:22 -06:00
Nathaniel Nicandro
656a2d913b Add org-babel-jupyter tests 2018-02-12 10:49:41 -06:00
Nathaniel Nicandro
d879e743a4 Refactor tests 2018-02-12 10:49:28 -06:00
Nathaniel Nicandro
56a36b8fa0 Remove the need to queue messages in a complicated way
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.
2018-02-12 10:47:26 -06:00
Nathaniel Nicandro
ad0aefe307 Handle error messages through the IOPub error handler or callbacks
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.
2018-02-12 10:25:36 -06:00
Nathaniel Nicandro
24eb475443 Cleanup comments 2018-02-12 10:25:13 -06:00
Nathaniel Nicandro
98c646bfb5 Block until a channel is stopped in jupyter-stop-channel for async channels 2018-02-12 10:22:13 -06:00
Nathaniel Nicandro
c4170acb77 Remove jupyter-repl-restart-channels
The channel process should not have to be restarted. This was needed because
signals weren't being handled properly in the subprocess.
2018-02-09 17:25:15 -06:00
Nathaniel Nicandro
86be51eb72 Don't rely on the event string in a process sentinel 2018-02-09 17:23:46 -06:00
Nathaniel Nicandro
b0186f3201 Take into account messages with no associated requests
For example, IOPub messages from other clients
2018-02-09 17:22:45 -06:00
Nathaniel Nicandro
9650fecf82 Remove uses of jupyter-request-run-handlers-p 2018-02-09 17:22:27 -06:00
Nathaniel Nicandro
b68404970f Add jupyter-repl-language-mode 2018-02-09 17:21:10 -06:00
Nathaniel Nicandro
d73fd28d4d Handle edge case when point-min is the beginning of a cell 2018-02-09 17:18:29 -06:00
Nathaniel Nicandro
255247788c Remove uses of seq functions
Since this is an emacs 25 dependency and there were not many uses of these
functions, remove them.
2018-02-09 09:11:57 -06:00
Nathaniel Nicandro
5f72b85db3 Refactor jupyter-repl-code-context-at-point for readability
Also remove unused code
2018-02-09 03:16:50 -06:00
Nathaniel Nicandro
58f1135262 Add a way to transform kernel results based on kernel language
For example for python kernels, we would like to convert results to tables if
they look like a table.
2018-02-08 14:15:27 -06:00
Nathaniel Nicandro
a2decc7baf Selectively inhibit REPL handlers when executing a Jupyter src-block
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.
2018-02-08 13:44:40 -06:00
Nathaniel Nicandro
b5f958ac99 More granular way of inhibiting handlers
`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.
2018-02-08 13:39:55 -06:00
Nathaniel Nicandro
4121cee1ba Use jupyter-repl-cell-code-beginning-position when getting position in cell code 2018-02-08 12:49:17 -06:00
Nathaniel Nicandro
d1e008e6d1 Fix edge case in history navigation
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.
2018-02-08 12:29:08 -06:00
Nathaniel Nicandro
ff51ee8740 Remove the busy status of a cell when an idle message is received 2018-02-08 12:14:35 -06:00
Nathaniel Nicandro
e032285f9a [WIP] Make ob-jupyter unaware of the REPL buffer
Try not to modify the REPL buffer in any way from `ob-jupyter` except for
inserting a code cell.
2018-02-07 17:28:33 -06:00
Nathaniel Nicandro
dc7c1e00e8 More generic extraction of image data from html image 2018-02-07 17:26:25 -06:00
Nathaniel Nicandro
83881bf4e0 Ensure the startup message is caught
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.
2018-02-07 12:08:07 -06:00
Nathaniel Nicandro
48c07e1f04 Do nothing when there is no render parameter when clearing/injecting one 2018-02-06 17:46:47 -06:00
Nathaniel Nicandro
5f902e1593 Remove unused code 2018-02-06 17:46:07 -06:00
Nathaniel Nicandro
a28952c643 Silence byte compiler 2018-02-06 17:45:53 -06:00
Nathaniel Nicandro
2a602246de Revert back to correct behavior 2018-02-06 17:45:12 -06:00
Nathaniel Nicandro
85efbf9c04 Refactor org-babel-jupyter-prepare-result
- 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`
2018-02-06 16:49:48 -06:00
Nathaniel Nicandro
072dce7c00 Negligible changes 2018-02-04 18:22:56 -06:00
Nathaniel Nicandro
43fc5a6ab8 Remove superfluous newlines when executing code 2018-02-04 18:21:12 -06:00
Nathaniel Nicandro
731480a4dd Don't add a newline in stream output 2018-02-04 18:20:11 -06:00
Nathaniel Nicandro
f466b3adcc [WIP] Better support for display-data messages 2018-02-04 18:19:08 -06:00
Nathaniel Nicandro
8d7e0a3bd7 Update comments 2018-02-04 18:18:19 -06:00