Commit graph

33 commits

Author SHA1 Message Date
conao3
1546a72f57 clean header 2020-03-10 23:39:35 -05:00
Nathaniel Nicandro
53da538b66 jupyter-org-hydra/body: Add scratch buffer binding 2019-09-23 20:43:39 -05:00
Nathaniel Nicandro
d11aa3f10d Fix byte compile warning 2019-07-24 17:28:25 -05:00
Nathaniel Nicandro
6650dd3588 Bump version 2019-07-24 16:03:22 -05:00
Nathaniel Nicandro
1e6e83c12e Preserve outline visibility
* jupyter-org-extensions.el (jupyter-org-closest-jupyter-language)
(jupyter-org-between-block-end-and-result-p):
(jupyter-org-next-busy-src-block):
(jupyter-org-move-src-block): Do it.
2019-07-24 14:40:55 -05:00
Nathaniel Nicandro
cd127c5cb4 Silence byte compiler warning 2019-07-18 17:08:53 -05:00
Nathaniel Nicandro
653f934bfc Add jupyter-org-(next|previous)-busy-src-block
* jupyter-org-extensions.el (jupyter-org-next-busy-src-block)
(jupyter-org-previous-busy-src-block): Do it.
(jupyter-org-hydra/body): Add N and P bindings.
2019-07-14 17:20:41 -05:00
Nathaniel Nicandro
1e9da5753d Add jupyter-org-interrupt-kernel
* jupyter-org-extensions.el (jupyter-org-interrupt-kernel): Do it.
(jupyter-org-hydra/body): Add i binding.

* jupyter-repl.el (jupyter-repl-interrupt-kernel): Clarify error message.
2019-07-14 17:20:18 -05:00
Nathaniel Nicandro
e084842242 jupyter-org-insert-src-block: Don't move past an inlinetask 2019-07-10 19:24:06 -05:00
Nathaniel Nicandro
642b0ef592 jupyter-org-insert-src-block: Be aware of a src-block's results
When `point` is between a src-block and its result with only whitespace
separating the end of a src-block and the beginning of its results, insert a
new src-block after the result.
2019-07-10 17:28:58 -05:00
Nathaniel Nicandro
909cdf3dd7 jupyter-org-insert-src-block: Add blank lines where appropriate 2019-07-01 11:49:17 -05:00
Nathaniel Nicandro
9dd8e8d9ec Localize functions defined in jupyter-base.el to their call sites
Fixes #137

* jupyter-base.el (jupyter-kernelspec): Un-require.
(jupyter-command, jupyter-locate-python)
(jupyter-runtime-directory): Move to new file `jupyter-env.el`
(jupyter-include-other-output, jupyter-iopub-message-hook)
(jupyter-shell-message-hook)
(jupyter-stdin-message-hook): Move to `jupyter-client.el`
(jupyter-sha256, jupyter-hmac-sha256):
(jupytern-new-uuid): Move to `jupyter-messages.el`. Add declaration of
`jupyter-new-uuid` to account for its removal.
(jupyter-create-connection-info)
(jupyter-write-connection-file): Move to `jupyter-kernel-manager.el`
(jupyter-connect-endpoint, jupyter-connect-channel): Move to `jupyter-channels.el`

* jupyter-channels.el: Accept moved functions.

* jupyter-client.el: Accept moved variables.

* jupyter-kernel-manager.el: Accept moved functions.
(jupyter-env, jupyter-kernelspec): New requires.

* jupyter-kernelspec (jupyter-env): New require.
(jupyter-command): Remove declaration.
(jupyter-read-plist-from-string): New declaration.

* jupyter-messages.el: Accept moved functions.
(hmac-def, json): New requires.

* jupyter-org-extensions.el (jupyter-kernelspec): New require.

* jupyter-repl.el (jupyter-kernelspec): New require.

* jupyter-env.el: New file.

* ob-jupyter.el (jupyter-env, jupyter-kernelspec): New requires.

* test/jupyter-test.el (jupyter-env): New require.
2019-06-29 10:29:55 -05:00
Nathaniel Nicandro
1e84b42f42 Silence byte compile warning 2019-06-22 21:56:00 -05:00
Nathaniel Nicandro
f023339a85 jupyter-org-insert-src-block: Respect the element under point 2019-06-22 21:54:00 -05:00
Nathaniel Nicandro
5ea32a70f0 Change License to GPL3 2019-05-31 09:44:39 -05:00
Nathaniel Nicandro
112769e0c6
Bump version 2019-05-04 03:31:50 -05:00
UndeadKernel
f6421ab72e org-extensions: (un)fold src block hydra command (#95) 2019-04-24 21:56:47 -05:00
Nathaniel Nicandro
128a10c156 jupyter-org-insert-src-block: Simplify insertion of blank lines 2019-04-01 21:44:00 -05:00
Nathaniel Nicandro
6a1afa1623
jupyter-org-restart-and-execute-to-point: Make argument optional 2019-03-31 10:40:09 -05:00
Nathaniel Nicandro
03ead7392e
jupyter-org-insert-src-block: Avoid space at end of header line 2019-03-31 10:40:09 -05:00
Nathaniel Nicandro
2c005cab7b
jupyter-org-insert-src-block: Find the closest language to use
If `point' is not on a source block, look near `point' for a source block with
a Jupyter language and use that one.

Closes #66.
2019-03-29 00:37:38 -05:00
Nathaniel Nicandro
fbdbe60c95 Add jupyter-org-execute-subtree 2019-03-28 23:29:02 -05:00
Nathaniel Nicandro
7301d6a58c jupyter-org-execute-to-point: Be more aware of the kernel session 2019-03-28 23:29:02 -05:00
Nathaniel Nicandro
5c1643bf77
jupyter-org-jump-to-visible-block: Don't byte compile undefined macro
`avy-with` is a macro that might not be defined at compile time, but at the
same time we do not want to depend on `avy` so we have to ensure that we only
do byte compilation when first loading the function at run time.
2019-03-28 21:55:42 -05:00
Nathaniel Nicandro
67984994a8
jupyter-org-insert-src-block: Consider edge cases when preserving whitespace 2019-03-23 23:33:24 -05:00
Nathaniel Nicandro
7c2e32dfb4
jupyter-org-insert-src-block: Preserve whitespace when inserting src-block 2019-03-23 22:47:40 -05:00
Nathaniel Nicandro
83af335166
Bump version 2019-03-14 09:29:11 -05:00
Nathaniel Nicandro
7e0470c129
Fix indentation 2019-03-14 09:29:11 -05:00
Nathaniel Nicandro
f28d4a5400
Avoid recursive require when loading ob-jupyter
This can happen, e.g. when loading jupyter-org-client.el directly from source
since `org-element` requires `org`.
2019-03-14 09:29:11 -05:00
Nathaniel Nicandro
139949528c
jupyter-org-jump-to-block: Consider nil context 2019-03-14 02:33:03 -05:00
Nathaniel Nicandro
75648917cb
jupyter-org-select-block-and-results -> jupyter-org-src-block-bounds 2019-03-14 02:28:30 -05:00
Nathaniel Nicandro
23481e1d51
Add jupyter-org-inspect-src-block 2019-03-14 02:28:25 -05:00
UndeadKernel
d065b2f25c Port scimax's source block helper functions (#45)
* Port scimax's org facility functions

We provide a hydra to easily use the functions.
By default, the binding to call the hydra is `C-c h`
The hydra is only created if the hydra package is loaded.

* Move org extensions to its own file.

* Integrate revision comments

* Replaced manual placement of src blocks with
`org-element-interpret-data`
* Refactor some functions

* Add a hydra to `jupyter-org-interaction-mode-map`

Only actually define the Hydra if the package `hydra` exists.

* Refactor org extension functions.

* org-extensions: refactor and cleanup

* Remove compiler warnings
* Change condition-case for ignore-errors
* Functions that restart the kernel now work
* Use ivy and avy functions only if package exists

* org-extensions: change hydra bindings

* Match the hydra bindings better to emacs conventions

* org-extensions: improvements and code refactoring

* add where external functions should be found
* take into account empty RESULTS when moving blocks

* org-extensions: use context variable for jumping

* org-extensions: improve jumping to block function

* Set a default variable to specify how many lines of context to show
* Consider the case when a user supplies the nil value
2019-03-14 02:26:30 -05:00