Commit graph

10 commits

Author SHA1 Message Date
Nathaniel Nicandro
a38df0b29f jupyter-handle-error: Only call Python specialized method in the REPL 2018-11-26 12:37:37 -06:00
Nathaniel Nicandro
081f329da1 v0.6.0 2018-11-16 00:27:47 -06:00
Nathaniel Nicandro
0052d9b30f jupyter-insert: Only fontify the docstring region for Python inspect requests
* jupyter-python.el (jupyter-insert): Do it.
2018-11-15 23:04:27 -06:00
Nathaniel Nicandro
a819067e6c Implement the jupyter-org-result method
This is in replacement of the `jupyter-org-prepare-result` and
`jupyter-org-transform-result`. A single method with both primary and :around
methods is sufficient.

* jupyter-org-client.el (jupyter-org-mime-types): New variable.
(jupyter-org-prepare-and-add-result): Remove.
(jupyter-handle-execute-result, jupyter-handle-display-data):
Do the work previously done by `jupyter-org-prepare-and-add-result`.
Abstract out the python handling to a `jupyter-org-result` method.
(jupyter-org--image-result): Add PARAMS argument.
Move setup done previously in `jupyter-org-prepare-result` to this function.
(jupyter-org-prepare-result): Remove.
Replace with calls to the `jupyter-org-result' method.
(jupyter-org-result): New method.
(text/html) Remove special handling of <img> tags, this was done due to old
versions of the Julia kernel.
(jupyter-org-transform-result): Remove.
Replace with a `jupyter-org-result` :around method.
Remove all callers.

* jupyter-python.el (jupyter-org-transform-result): Remove.
Replace with a `jupyter-org-result` :around method.

* jupyter-tests.el (jupyter-org-result): Add tests.

org-result
2018-11-13 17:46:07 -06:00
Nathaniel Nicandro
df64f6b801 Add jupyter-fontify-region-according-to-mode
* jupyter-mime.el (jupyter-fontify-region-according-to-mode): Do it.

* jupyter-python.el (jupyter-insert): Use it.
2018-11-13 17:46:07 -06:00
Nathaniel Nicandro
e01f8df624 Remove jupyter-repl-insert-message
The purpose of this function was to conveniently insert a message property list
and allow contributors to perform post insert fixing up depending on the
mimetype inserted via the method `jupyter-repl-after-insert-message`. This same
effect can be done by extending `jupyter-insert` without the need of adding a
new method.

* jupyter-repl.el (jupyter-repl-insert-message):
(jupyter-repl-after-insert-message): Remove.
(jupyter-inspect): Replace calls to `jupyter-repl-insert-message` with
`jupyter-insert`.

* jupyter-python.el (jupyter-repl-after-insert-message): Replace with
`jupyter-insert` :around method.
2018-11-13 17:46:07 -06:00
Nathaniel Nicandro
06ae31a699 jupyter-repl-after-insert-message: Fontify Python doc strings after inspect requests 2018-10-31 18:49:37 -05:00
Nathaniel Nicandro
b1bbfd0e1a Move python specific traceback handling to jupyter-python.el 2018-10-27 22:16:54 -05:00
Nathaniel Nicandro
795c9b2542 Add jupyter-load-file-code 2018-10-25 23:59:47 -05:00
Nathaniel Nicandro
8896e88476 Move language support definitions to their own files
* Define `jupyter-load-language-support` which takes a client and loads the
  language support definitions of the client's kernel language.

* Call `jupyter-load-language-support` when initializing a REPL buffer in
  `jupyter-repl-mode`. Note this also takes care of loading the kernel support
  for a `jupyter-org-client' since a REPL buffer is setup before evaluating any
  `org-mode` source code blocks.

* Move language specific methods to their own files named `jupyter-LANGUAGE.el`
2018-10-25 23:59:46 -05:00