Commit graph

315 commits

Author SHA1 Message Date
Nathaniel Nicandro
63717b9e39
Bump version 2019-02-12 09:17:06 -06:00
Nathaniel Nicandro
034f309222
Add jupyter-display-current-buffer-reuse-window
Closes #27.
2019-02-11 16:01:41 -06:00
Nathaniel Nicandro
7ddbcc1efc
Cleanup documentation 2019-02-10 02:25:05 -06:00
Nathaniel Nicandro
3d6dece151 Fix jupyter-inspect in org-mode 2019-02-09 14:33:00 -06:00
Sebastian Pech
81f9f60705 Add variables to customize how short evaluation results are displayed (#21)
* Add `jupyter-eval-short-result-display-function`

* Add `jupyter-eval-short-result-max-lines`
2019-02-08 19:28:54 -06:00
Nathaniel Nicandro
5f264ab03a
jupyter-eval-string: Remove redundancy 2019-02-07 13:34:36 -06:00
Nathaniel Nicandro
0a34860707
Fix package-lint errors 2019-02-07 11:17:24 -06:00
Nathaniel Nicandro
771e267034
Fix checkdoc errors 2019-02-06 22:49:41 -06:00
Nathaniel Nicandro
d709b31a64
Add jupyter-message-lambda
This simplifies the writing of message callbacks.
2019-01-22 18:39:17 -06:00
Nathaniel Nicandro
e01f09d97e
Add jupyter-kernel-busy-p 2019-01-18 22:06:37 -06:00
Nathaniel Nicandro
4795032335
jupyter-completion-prefix: Complete argument lists only in IJulia
Python will interpret a completion request here as asking for all possible
completions which is slow.
2019-01-18 22:02:24 -06:00
Nathaniel Nicandro
876c080f7f
Add jupyter-kernel-language-mode-properties and related functions 2019-01-17 19:53:04 -06:00
Nathaniel Nicandro
0dd3946e1e
jupyter-inspect: Increase default timeout 2019-01-16 17:54:59 -06:00
Nathaniel Nicandro
5689819fc6
jupyter-eval-string: Handle stderr 2019-01-16 17:54:44 -06:00
Nathaniel Nicandro
6b7ecfcf08
Add execution-count slot to a jupyter-kernel-client
This allows the default `jupyter-kernel-client' implementation to do the work
of updating the execution count instead of having subclasses track it.
2019-01-13 22:19:25 -06:00
Nathaniel Nicandro
0c92afea26
Add the jupyter-handle-payload method
This replaces the `jupyter-repl--handle-payload` function and allows payloads
to be handled in other contexts than the REPL, for example inserting a new
source block when receiving a set_next_input payload for the `org-mode` client.
2019-01-13 22:19:25 -06:00
Nathaniel Nicandro
86ec099379
jupyter-completion-at-point: Inhibit completion when the kernel is busy 2019-01-12 20:27:19 -06:00
Nathaniel Nicandro
38d6712200
jupyter-eval-string: Include the error name 2018-12-28 12:59:03 -06:00
Nathaniel Nicandro
f5fe8df750
Cleanup of function documentation 2018-12-28 12:59:03 -06:00
Nathaniel Nicandro
03141c6535
jupyter-read-expression: Cleanup variables on minibuffer exit 2018-12-19 21:09:32 -06:00
Nathaniel Nicandro
3debb298e1
jupyter-completion--arg-extract: Handle ; in Julia kernels
This also saves the separator after an argument so that
`jupyter-completion--make-arg-snippet` uses the right separator (either `,` or
`;`)
2018-12-19 20:56:47 -06:00
Nathaniel Nicandro
ee0402ab8e
jupyter-inspect: Ensure jupyter-current-client is valid 2018-12-19 20:55:42 -06:00
Nathaniel Nicandro
bc7f9b4fb5
jupyter-eval: Raise an error if one is returned by the kernel 2018-12-11 21:36:00 -06:00
Nathaniel Nicandro
6f67c0a3d5
jupyter-eval-string: Fix wrong interactive spec 2018-12-11 21:34:57 -06:00
Nathaniel Nicandro
7c01766da3
jupyter-completion--arg-extract: Don't assume spaces exist after separator 2018-12-10 21:36:35 -06:00
Nathaniel Nicandro
8fdde6c756
Update some documentation 2018-12-10 21:36:35 -06:00
Nathaniel Nicandro
4683785553
jupyter-eval: Inhibit client handlers 2018-11-29 02:02:02 -06:00
Nathaniel Nicandro
a9caf5185a Add jupyter-region-context
Also update the default code context for completion requests to be the current
line up to `point`.

This allows completion in python kernels to work as expected. Previously when
sending the whole line, the python completer would not return expected results.
For example, if you had something like

os.mkdir(os.path.|, 0777)

then you would not receive any completions for the os.path namespace, only for
the global namespace.
2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
74130eaab2 jupyter-inspect: Don't capture a reference to a client
Ensure that `help-setup-xref` doesn't keep the client around longer than
expected.
2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
512dcafc46 jupyter-completion--company-idle-begin: Behave similarly to company-post-command 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
c9a5651245 jupyter-eval: Display a message if no results are returned 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
4ad72e4781 Rename jupyter-output-buffer-* to jupyter-display-buffer-*
An output buffer implies output from the kernel, but they are used for more
general purposes other than displaying output form the kernel.
2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
fca89359fd Rename jupyter-repl-display-traceback to jupyter-display-traceback
Also move the function to jupyter-client.el from jupyter-repl.el

* jupyter-repl.el (jupyter-repl-display-traceback): Do it.

* jupyter-client.el (jupyter-display-traceback): Do it.
2018-11-21 12:35:34 -06:00
Nathaniel Nicandro
872c5cde79 Ensure the execution state is always set regardless of jupyter-inhibit-handlers
`jupyter-iopub-message-hook` is called in a channel's `jupyter-handle-message`
method, but setting the execution state should be independent of the value of
`jupyter-inhibit-handlers. So move setting the execution state into the
client's `jupyter-handle-message` method.
2018-11-21 12:35:30 -06:00
Nathaniel Nicandro
6a1da44904 Move evaluation functions from jupyter-repl.el to jupyter-client.el
These functions are general and not only useful for REPLs.
2018-11-19 08:50:32 -06:00
Nathaniel Nicandro
50ac28910a Remove usage of deprecated when-let
This was deprecated in Emacs 26.1
2018-11-16 04:59:09 -06:00
Nathaniel Nicandro
081f329da1 v0.6.0 2018-11-16 00:27:47 -06:00
Nathaniel Nicandro
42cc3d3853 Do not use the make- prefix for struct constructors 2018-11-16 00:27:47 -06:00
Nathaniel Nicandro
823ea8adde Fix checkdoc warnings 2018-11-15 23:04:27 -06:00
Nathaniel Nicandro
5a7c083169 More reliably capture the startup message
It still sometimes isn't caught but it is more reliable. This mainly affects
testing.

* jupyter-client.el (jupyter-start-channels): Add a small delay after starting
  channels.

* jupyter-kernel-manager.el (jupyter-start-kernel): Remove superfluous delay.
2018-11-15 23:04:27 -06:00
Nathaniel Nicandro
b45321b181 Add jupyter--run-handler-p
Split from `jupyter--run-handler-maybe`. Makes for easier testing of the
handler logic.

* jupyter-client.el (jupyter--run-handler-maybe): Use it.
2018-11-15 23:04:27 -06:00
Nathaniel Nicandro
fbdcac6c37 Silence byte compiler 2018-11-15 23:04:27 -06:00
Nathaniel Nicandro
45a62b6b81 jupyter-inspect: Insert the message property list 2018-11-15 23:04:27 -06:00
Nathaniel Nicandro
b44c8871d4 Cleanup a clients ioloop process through finalizers
* jupyter-client.el (initialize-instance): Stop channels in finalizer.

* jupyter-ioloop.el (jupyter-ioloop--make-filter): New function.
(jupyter-ioloop-start): Make a weak reference OBJECT.
2018-11-15 23:04:27 -06:00
Nathaniel Nicandro
9d0976e1ed jupyter-eval: Verify that a client is available 2018-11-15 23:04:27 -06:00
Nathaniel Nicandro
53ff8635fc Split ioloop initialization into :before and :after methods 2018-11-15 23:04:27 -06:00
Nathaniel Nicandro
c0e47165a9 Add instance tracker class
This is needed as opposed to eieio-instance-tracker so that we can create weak
references to objects. We don't want to have to manually delete an instance.

* jupyter-base.el (jupyter-instance-tracker): Do it.
(jupyter-all-objects): New function.

* jupyter-client.el (jupyter--clients): New variable.
(jupyter-kernel-client): Inherit from new class.
(jupyter-clients): Use jupyter-all-objects.

* jupyter-kernel-manager.el (jupyter-kernel-managers): New function.
2018-11-15 23:04:25 -06:00
Nathaniel Nicandro
134f84a59c Add object finalizer class
* jupyter-base.el (jupyter-finalized-object): New class.
(initialize-instance): New method addition.
(jupyter-add-finalizer): New method.

* jupyter-client.el (jupyter-kernel-client):
Inherit from jupyter-finalize-object.
(initialize-instance): Cleanup private buffer when client loses scope.
(jupyter-finalize): Remove.

* jupyter-kernel-manager.el (jupyter-kernel-manager):
Inherit from jupyter-finalized-instance.
(jupyter-kernl-manager--cleanup): New function.
(jupyter-finalize, jupyter-kill-kernel-managers): Remove. Update all callers.
(jupyter--kernel-sentinel): Remove MANAGER argument. Update all callers.
(jupyter--start-kernel): Remove MANAGER argument. Update all callers.
(jupyter-start-kernel): Add finalizer to kernel process to cleanup conn-file.

* jupyter-repl.el (jupyter-repl-kill-buffer-query-function):
Remove calls to jupyter-finalize.
2018-11-15 23:02:41 -06:00
Nathaniel Nicandro
ba13ef2419 Move inspection related functions to jupyter-client.el
* jupyter-repl.el (jupyter-inspect, jupyter-inspect-at-point): Do it.

* jupyter-client.el: See above.
2018-11-13 18:17:44 -06:00
Nathaniel Nicandro
a82ae13438 Add jupyter-with-timeout macro
* jupyter-base.el (jupyter-default-timeout)
(jupyter-long-timeout): Moved from jupyter-client.el
(jupyter-with-timeout): Do it.

* jupyter-client.el (jupyter-wait-until): Use it.

* jupyter-kernel-manager.el (jupyter-shutdown-kernel)
(jupyter-interrupt-kernel, jupyter-start-new-kernel):
(jupyter-start-kernel): Use it.

use timeout
2018-11-13 17:46:19 -06:00