Commit graph

1241 commits

Author SHA1 Message Date
Nathaniel Nicandro
32ce9d33bc Fix jupyter-instance-tracker initialization
A property of the tracking symbol was being checked instead of the symbol's
value.
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
46e0c24930 Update org-mode tests 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
c580543cc7 jupyter-insert: Search for required field when fontifying Python inspect results
The Type: field will always be present in an inspect request.
2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
2a7b221009 Don't require an external package that may not exist everywhere 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
383f897023 Small refactoring 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
3781c07151 Add the jupyter-org-error-location method
This method is to support jumping to the line where an error occurred in a code
block directly from the `org-mode` buffer.
2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
2ac0a8b621 Do not conform to the semantics of org-babel-insert-result
There was an ugly hack that destructively modified the source block parameters
supplied to the org-babel execute function to make `org-babel-insert-result` do
all of the insertion work. This relied too much on knowing the internals of
that function. I also could never figure out how to insert stream results in a
clean way.

Instead we manually insert the results by taking advantage of the `org-element`
API. Specifically the function `org-element-interpret-data` which takes an org
syntax tree and returns its printed representation. Now the
`jupyter-org-result` method returns either a string or a syntax tree. If the
latter is returned, it is filtered through `org-element-interpret-data` to
obtain the string representation for insertion.

In addition, all source blocks insert results in a RESULTS drawer. This allows
for inserting stream output as raw text in the drawer and allows for a way to
append results since the end of the drawer acts as an insertion point.
2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
acaafd46be Exclude some package files used for development 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
a7148927fe Add jupyter-repl-propertize-regex
Previously, when propertizing the output of the REPL, a regular expression was
generated every time to take into account the comment characters of the kernel
language. Adding this variable ensure that we only create the expression once.
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
99a50c7b80 Satisfy the :dir source block argument when initializing a session 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
faa28913dc Update org-mode tests 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
916b2cf912 jupyter-with-message-content: Fix debug declaration 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
f534fe16df jupyter-org-result: Wrap markdown results in an export block
This is to be consistent with other results that are wrapped in a block such as
latex results.
2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
a38df0b29f jupyter-handle-error: Only call Python specialized method in the REPL 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
4d494607fd Rework `org-mode' source block completion
Cache the current source block's information so that there is no need to
constantly retrieve it during completion.
2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
cec69a6d30 Change jupyter- org-mode prefix to jupy-
This is to avoid name clashing with another popular package that uses the same
prefix.
2018-11-24 22:13:28 -06:00
Nathaniel Nicandro
99c0bf0f55 Remove unused code 2018-11-21 12:35:34 -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
2f7268c8dc Temporarily set the timezone when testing time encoding/decoding 2018-11-17 16:26:03 -06:00
Nathaniel Nicandro
7783e402f9 jupyter-insert-html: Recognize html that should be parsed as XML
If the `text/html` results returned from the kernel contain an XML prolog then
use `libxml-parse-xml-region` to parse the results otherwise use
`libxml-parse-html-region`.

* jupyter-mime (jupyter-insert-html): Do it.

* test/jupyter-test.el (jupyter-html-output): Add test for html output.
2018-11-17 15:43:40 -06:00
Nathaniel Nicandro
c859d34faf Add jupyter-repl-cell-output
* jupyter-repl.el (jupyter-repl-cell-output): Do it.
2018-11-17 15:24:11 -06:00
Nathaniel Nicandro
465d3222a4 Delete all script tags before parsing html
There is an issue where SVG images containing script tags would cause the SVG
render to error.
2018-11-17 15:00:49 -06:00
Nathaniel Nicandro
9f52459325 Add Travis badge 2018-11-17 12:21:57 -06:00
Nathaniel Nicandro
1b8032f5ef jupyter-get-buffer-create: Remove unnecessary keybindings
`special-mode' already provides they keybindings.
2018-11-17 11:53:05 -06:00
Nathaniel Nicandro
6aed12011a jupyter-repl-append-output: Mark output as read only
This used to be done by `jupyter-repl-insert`, but this is no longer the case
as all insertion of results is handled by the functions in jupyter-mime.el
while `jupyter-repl-insert` is more specific to insertion in the REPL buffer.
2018-11-17 11:47:55 -06:00
Nathaniel Nicandro
82cea4c0d1 Break up large tests into smaller ones 2018-11-17 11:47:55 -06:00
Nathaniel Nicandro
df44d53528 Tests work on Travis 2018-11-17 11:47:55 -06:00
Nathaniel Nicandro
1ecd029f6c More clearly show that an error occurs if no kernel info is received
* jupyter-kernel-manager.el (jupyter--error-if-no-kernel-info): New function.
(jupyter-start-new-kernel): Use it.
2018-11-17 11:47:55 -06:00
Nathaniel Nicandro
4842ac2198 jupyter-delete-all-kernels: Remove old cleanup
`jupyter-kernel-manager--cleanup` is intended to replace what was removed.
2018-11-17 11:47:55 -06:00
Nathaniel Nicandro
890453b716 Re-work last commit 2018-11-16 14:23:16 -06:00
Nathaniel Nicandro
b67262f0f5 Take into account Travis' python version for tests 2018-11-16 13:37:14 -06:00
Nathaniel Nicandro
e04a81a3ad jupyter-fontify-buffer: Don't store fontify buffers 2018-11-16 17:29:47 +00:00
Nathaniel Nicandro
b39f9020c5 jupyter-fontify-according-to-mode: Don't show the fontify buffer 2018-11-16 17:24:18 +00:00
Nathaniel Nicandro
78a0747ddb Call after change function only when change is due to cell code
* jupyter-repl.el (jupyter-repl-do-after-change): Do it.
(jupyter-repl-after-change): Remove check that is now done at a higher level.
2018-11-16 17:22:10 +00:00
Nathaniel Nicandro
5ef71de62b Use universal time when testing encoding/decoding of time values 2018-11-16 12:08:02 +00:00
Nathaniel Nicandro
f0849c855a Install a kernelspec using the right python in Travis tests 2018-11-16 05:26:37 -06:00
Nathaniel Nicandro
5e09b4d78f Show Jupyter paths in Travis test output 2018-11-16 05:10:19 -06:00
Nathaniel Nicandro
fbeb0dba0b jupyter-start-kernel: Handle all return values of file-attributes 2018-11-16 05:09:52 -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
ca44a3922d Use universal time when encoding time values
* jupyter-messages.el (jupyter--encode-time): Do it.

* test/jupyter-test.el (jupyter-messages): Update test.
2018-11-16 04:49:43 -06:00
Nathaniel Nicandro
bfe549a0f5 Ensure Jupyter directories exist during testing 2018-11-16 04:27:57 -06:00
Nathaniel Nicandro
3258dc752e Export build variables for zmq in Travis tests 2018-11-16 04:03:01 -06:00
Nathaniel Nicandro
e4546e53ae Fix Travis, attempt 6
Travis really doesn't like strings.
2018-11-16 03:44:05 -06:00
Nathaniel Nicandro
178f5d1212 Fix Travis, attempt 5 2018-11-16 02:58:36 -06:00
Nathaniel Nicandro
3515b30b9a Fix Travis, attempt 4
Travis seems to consider the # character in a funny way.
2018-11-16 02:39:50 -06:00