Commit graph

798 commits

Author SHA1 Message Date
Nathaniel Nicandro
9c99e5f2f9 Add jupyter-org-file-header-arg-p 2018-10-25 22:10:16 -05:00
Nathaniel Nicandro
23acb30759 Refactor jupyter-org-clear-request-id to use the jupyter-org-request fields 2018-10-25 22:10:16 -05:00
Nathaniel Nicandro
30db9a8b2b Handle kernel differences in message sequence during execution 2018-10-16 13:55:57 -05:00
Nathaniel Nicandro
44731bbf9f Mention why jupyter-include-other-output is needed in jupyter-restart-kernel 2018-10-16 13:55:57 -05:00
Nathaniel Nicandro
be7e2b62ee Ensure the correct line is moved to when handling edit payload 2018-10-16 13:55:57 -05:00
Nathaniel Nicandro
e1d73b77e1 Handle edge case in jupyter-repl-cell-code
If we are getting the code of the last cell in the buffer, `forward-line` will
return 0 when attempting to move past the last line of the buffer and `point`
will be at `point-max`.
2018-10-16 13:55:57 -05:00
Nathaniel Nicandro
0bf30538e6 Refactor encoding/decoding of message-part lists for readability 2018-10-16 13:55:57 -05:00
Nathaniel Nicandro
2b8be0c2cf Fix REPL history navigation
* Set the lazy highlight limit to only look at the current cell

* Simplify `jupyter-repl-history-next` and `jupyter-repl-history-previous`

* Properly restore isearch state when searching through history

* Add tests for REPL history navigation
2018-10-16 13:55:57 -05:00
Nathaniel Nicandro
a0a9ac2910 Update documentation, purge stale comments 2018-10-16 13:55:50 -05:00
Nathaniel Nicandro
ea0d186007 Silence byte compiler 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
d49256d708 Handle edge case in jupyter-repl-previous-cell
When `point` is already at the beginning of the first cell in a REPL buffer,
`jupyter-repl-previous-cell` would say that a motion was performed when in
reality it hadn't.
2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
355e0763c0 Always consider point-max as the end of a cell 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
44ec23bbf2 Support accessing kernelspecs on remote hosts 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
61b8b1250d [WIP] Add more tests 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
0248c81f27 Refactor jupyter-repl-initialize-fontification for readability 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
e94db94851 Refactor jupyter-repl-eval-file for readability 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
83fb582270 Remove duplicated code in jupyter-repl-eval-string
* Remove duplicated `string-trim` calls

* Allow the silently argument to be any non-nil value
2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
2945660017 Fix use of other-window-scroll-buffer 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
e54ec95317 Refactor prompt insertion
* Replace `jupyter-repl--insert-prompt` with `jupyter-repl--make-prompt` which
  only makes the prompt overlay and adds text properties to the overlayed
  character. `jupyter-repl--insert-prompt` would also insert the newline
  character for the overlay as well as recenter the overlays. These tasks are
  now handled by `jupyter-repl-insert-prompt`.

* Add notes on why an invisible character is inserted along with the prompts.

* `jupyter-repl-cell-code` properly handles invisible characters introduced by
  line continuation prompts.

* Don't make the invisible character inserted by continuation prompts
  read-only.

* Use a marker to keep track of the end position of the cell when inserting
  continuation prompts.

* Guard against searching past boundary when inserting continuation prompts
2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
de9f85cc2e Update documentation, cleanup comments
* Remove implementation details in documentation strings

* Canonicalize documentation of functions which perform similar operations.
2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
7b3e4f9f84 Fix encoding/decoding time objects
* Handle the case of no time specification by defaulting to midnight when
  decoding time

* Properly handle fractions in `jupyter--decode-time`

* Implement `jupyter--encode-time`

* Consider a time object to be a length 4 list of integers and encode the
  object using `jupyter--encode-time` when encoding in `jupyter--encode`

* Add tests for time decoding/encoding
2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
417162c439 Only switch to the REPL buffer when necessary 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
26c39c3d55 jupyter-repl--inspect accepts the detail argument for inspect messages 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
55449c1d6a Introduce jupyter-org-client
- A `jupyter-org-client` is a subclass of a `jupyter-repl-client` and replaces
  the use of callbacks in `org-babel-execute:jupyter` to handle the insertion
  of code block results in an `org-mode` buffer. `ob-jupyter.el` now only
  contains the integration with `org-babel` and all integration with
  `emcacs-jupyter` is placed in `jupyter-org-client.el`

- Introduce `jupyter-org-request`, which inherits all of the field of a
  `jupyter-request` and adds the fields necessary for keeping track of the
  source code block information a request was generated from during the
  lifetime of the request.
2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
7bd130e059 Always return the client in run-jupyter-repl 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
c3681bdb8c Add methods to hook into request creation/deletion
- Add the method `jupyter-generate-request` to allow subclasses to initialize
  their own request objects with extra fields in addition to those of
  `jupyter-request`.

- Add the method `jupyter-drop-request` to allow subclasses to do any cleanup
  once a request is complete.
2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
ba17924b5d Take into account the initial value of the buffer slot for a jupyter-repl-client 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
4566fce2e3 Allow supplying a client class in run-jupyter-repl and connect-jupyter-repl 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
aab35e6eed Include missing status field in execute-reply handler 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
ed793fc183 Use string-match-p instead of string-match 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
bbb677c573 Pop up traceback buffer on errors when executing code blocks 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
892ab84148 Silence byte compiler warnings 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
23cecb9c0f [WIP] Widget support in ob-jupyter 2018-10-16 13:55:30 -05:00
Nathaniel Nicandro
10a56c2f54 Refactor widget implementation
* Use the `target-name` argument in `jupyter-handle-comm-open`

* Remove hard-coded URL format and use the new variable
  `jupyter-widgets-url-format` instead

* Add `jupyter-widgets-supported-targets` to explicitly state which widget
  targets are supported

* Rename `widget-proc` to `widget-sock` in a `jupyter-widget-client`

* Initialize the widget socket only when opening a valid comm

  * Previously it was initialized when the client was initialized, but a client
    may not even create any widgets so the widget socket would be unused.

* Use `pcase` in `jupyter-widgets-on-message`

* Update documentation and commentary of `jupyter-widget-client`
2018-08-30 18:12:18 -05:00
Nathaniel Nicandro
2552b4ff99 Add notes on how EmacsJupyter works 2018-08-30 18:12:18 -05:00
Nathaniel Nicandro
c207bea8d4 Fix indentation 2018-08-30 18:02:25 -05:00
Nathaniel Nicandro
c7c50f4908 Better error reporting when the kernel process dies in jupyter-start-kernel 2018-08-30 18:02:25 -05:00
Nathaniel Nicandro
22b1e809a0 Update documentation, cleanup comments 2018-08-30 18:02:13 -05:00
Nathaniel Nicandro
ce3d9a377c Refactor jupyter--sign-message 2018-05-30 12:54:55 -05:00
Nathaniel Nicandro
122748b25e Do not pass the signature when signing message parts 2018-05-30 12:54:55 -05:00
Nathaniel Nicandro
7c218b233c Ensure that parts of a message that need to be dictionaries are encoded as such 2018-05-30 12:54:55 -05:00
Nathaniel Nicandro
81e3ebb44c Use jupyter-repl-language 2018-05-30 12:54:55 -05:00
Nathaniel Nicandro
8976a1d59e Remove special behavior of jupyter-repl-cell-count 2018-05-30 12:54:37 -05:00
Nathaniel Nicandro
04ecedd320 Only inhibit handlers when necessary
This ensures that any bookkeeping done in the handlers is actually performed.
2018-05-30 12:50:59 -05:00
Nathaniel Nicandro
d875ce7116 Do not display colon in prompts 2018-05-30 12:50:59 -05:00
Nathaniel Nicandro
382aa9999c Absorb displaying widgets into jupyter-repl-insert-data 2018-05-30 12:50:57 -05:00
Nathaniel Nicandro
d7a064cae5 Fix read-only error when inserting into the *jupyter-repl-output* buffer 2018-05-30 12:49:29 -05:00
Nathaniel Nicandro
3c34c1f7ed Do not handle reply messages with an error status specially 2018-05-30 12:49:28 -05:00
Nathaniel Nicandro
ff54004129 Do not rely on message time when dropping requests 2018-05-30 12:49:28 -05:00
Nathaniel Nicandro
70be58129e Rename jupyter-message-parent-message-type -> jupyter-message-parent-type 2018-05-30 12:49:28 -05:00