Commit graph

174 commits

Author SHA1 Message Date
Yevgnen
c5c2c84a0d Add jupyter-org-adjust-image-size (#147) 2019-07-14 12:44:31 -05:00
Nathaniel Nicandro
7c1689e33d jupyter-org-client.el: Don't assume non-empty strings 2019-07-11 16:40:37 -05:00
Nathaniel Nicandro
8f9ec15af0 Add jupyter-org-table-string 2019-06-30 12:22:26 -05:00
Jamie Forth
05d01ee1e5 jupyter-org-client.el: Check for tables when mime type is text/org
This allows for better integration with backends that can generate
org-format tables.
2019-06-28 20:12:52 -05:00
Nathaniel Nicandro
25ff5dd871 jupyter-org-client: Remove unnecessary block-params slot 2019-06-23 16:11:27 -05:00
Nathaniel Nicandro
4533246173 Fix customization type of jupyter-org-pandoc-convertable 2019-06-13 10:48:04 -05:00
Nathaniel Nicandro
08b90d48fa jupyter-org-define-key: Fix key lookup test 2019-06-13 00:32:26 -05:00
Nathaniel Nicandro
99986e5978 jupyter-org-client.el: More robustly handle async insertion
Make less assumptions about where `point` is at when inserting results and
about the insertion context by relying only on
`org-babel-where-is-src-block-result` to move `point`. Centralize handling of
`point` to `jupyter-org--do-insert-result`.

* jupyter-org-client.el
(jupyter-org--first-result-context-p): Handle more cases.
(jupyter-org--append-stream-result-p): New function.
(jupyter-org--prepare-append-result): New function, abstracted from
`jupyter-org--insert-result`.
(jupyter-org--normalized-insertion-context): New function.
(jupyter-org--do-insert-result): New function.
(jupyter-org--insert-result): Move the bulk of the work to
`jupyter-org--do-insert-result`.
(jupyter-org--add-result): Use it.
2019-06-12 14:24:59 -05:00
Nathaniel Nicandro
fda5f0b414 jupyter-org-font-lock-ansi-escapes: Fix regexp for fixed-width blocks 2019-06-11 22:12:58 -05:00
Nathaniel Nicandro
9f15db7133 jupyter-org--append-to-example-block: Fix edge case
Fix the case when appending to a line without inserting a newline and adding
indentation.

Also add tests for `jupyter-org--append-to-example-block`
2019-06-11 22:12:58 -05:00
Nathaniel Nicandro
945c60b7cd Revert "jupyter-org--append-to-example-block: Remove indentation handling"
This reverts commit a24e984b68.
2019-06-11 22:12:58 -05:00
Nathaniel Nicandro
eda7e6dcc6 jupyter-org--insert-result: Fix indentation to that of the #+RESULTS line 2019-06-11 22:12:58 -05:00
Nathaniel Nicandro
878b323594 jupyter-org--append-to-fixed-width: Fix edge case 2019-06-11 20:17:06 -05:00
Nathaniel Nicandro
047746eeae Fix checkdoc warning 2019-06-11 17:54:36 -05:00
Nathaniel Nicandro
6005177537 Add jupyter-org--first-result-context-p
Makes the code read better.
2019-06-11 15:23:49 -05:00
Nathaniel Nicandro
44e3823a93 jupyter-org--wrap-result-maybe: Use cond 2019-06-11 15:22:27 -05:00
Nathaniel Nicandro
87bd83c99b jupyter-org--clear-request-id: Check if clearing should be done first 2019-06-11 15:21:08 -05:00
Nathaniel Nicandro
74f83393ff jupyter-org-font-lock-ansi-escapes: Consider indentation 2019-06-10 23:08:14 -05:00
Nathaniel Nicandro
782b4a8a52 Remove jupyter-org--delete-unwrapped-result
Move its functionality directly into `jupyter-org--insert-result`.
2019-06-10 22:52:41 -05:00
Nathaniel Nicandro
a3c5494926 jupyter-org-request-async -> jupyter-org-request-async-p 2019-06-10 19:32:30 -05:00
Nathaniel Nicandro
a24e984b68 jupyter-org--append-to-example-block: Remove indentation handling
This is now handled by `jupyter-org--insert-result`.
2019-06-10 19:32:30 -05:00
Nathaniel Nicandro
9839a29c7c jupyter-org-client.el: Refactor async insertion
Also consider indentation when inserting results. This was fairly easy to do
and didn't seem to warrant a separate commit.

* jupyter-org-client.el
(jupyter-org--insert-element): Remove. Update all callers.
(jupyter-org-delete-blank-line): New function.
(jupyter-org--delete-element): Use it.
(jupyter-org--stream-context-p): Consider indentation.
(jupyter-org--fixed-width-append): Remove. Update all callers.
(jupyter-org--append-to-fixed-width): Move example block promotion to
`jupyter-org--append-stream-result`.
(jupyter-org--append-to-example-block): New function.
(jupyter-org--append-stream-result): Use it.
(jupyter-org-indent-inserted-region): New macro.
(jupyter-org--insert-result): New method that splits the bulk of the old
function `jupyter-org--append-result` into a more manageable structure. Uses
new macro.
(jupyter-org--append-result): Remove it. Update all callers.
(jupyter-org--add-result): Refactor to consider above changes.
2019-06-10 19:32:30 -05:00
Nathaniel Nicandro
f5499c614a Silence checkdoc warning 2019-06-10 16:11:11 -05:00
Nathaniel Nicandro
195576bdbf jupyter-org--ansi-color-apply-on-region: Use cond 2019-06-10 16:11:11 -05:00
Nathaniel Nicandro
d6393d8e51 jupyter-org-define-key: Only bind KEY once in the top-level map 2019-06-09 15:49:50 -05:00
Nathaniel Nicandro
932baad379 jupyter-org--set-current-src-block: Use org-babel-jupyter-language-p
So that we account for overriding the source block language.
2019-06-02 01:19:15 -05:00
Nathaniel Nicandro
5ea32a70f0 Change License to GPL3 2019-05-31 09:44:39 -05:00
Nathaniel Nicandro
b715ada492 Always name method arguments
If method arguments are not named it gives rise to errors like

    `Args out of range: "", 0`

that originate in `help-function-arglist` when calling `describe-function` on
those methods.
2019-05-09 13:32:45 -05:00
Nathaniel Nicandro
112769e0c6
Bump version 2019-05-04 03:31:50 -05:00
jackkamm
748598b7be Add pandoc conversion of rich outputs (#97) 2019-04-28 15:17:19 -05:00
Nathaniel Nicandro
80c623ab40
jupyter-org--set-current-src-block: Simplify calculation of block end
This also fixes an edge case when there is only one blank line after the source
block. The previous version would consider the beginning of the last line of
the code block as the end instead of the beginning of the `#+end_src` line in
that case.
2019-03-31 10:40:09 -05:00
Nathaniel Nicandro
9ff1722293
jupyter-org-with-src-block-client: Macro hygiene 2019-03-27 22:26:26 -05:00
Nathaniel Nicandro
3f3db53527 Handle ANSI escape sequences in org-mode src-block results 2019-03-20 21:08:53 -05:00
Nathaniel Nicandro
0499e187d0
jupyter-org--define-key-filter: Filter out keys when point is invisible 2019-03-19 13:21:55 -05:00
Nathaniel Nicandro
3b6b60d803 jupyter-org-insert-async-id -> jupyter-org-pending-async-results 2019-03-17 02:06:00 -05:00
Nathaniel Nicandro
3f489d3883 jupyter-org-with-src-block-client: Clarify when BODY is evaluated 2019-03-17 02:02:00 -05:00
Nathaniel Nicandro
40624d8930
Simplify quieting of message logging during source block evaluation 2019-03-15 12:53:15 -05:00
Nathaniel Nicandro
26f191a44b
Fix latex fragment toggling 2019-03-15 00:51:47 -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
662e983612
Don't require subr-x at runtime 2019-03-14 09:16:44 -05:00
Nathaniel Nicandro
0cfb156a7e
jupyter-org--wrappable-element-p: Consider error comments wrappable 2019-03-10 03:06:16 -05:00
Nathaniel Nicandro
6894a73d57
Cleanup stale comments 2019-03-07 22:51:25 -06:00
Nathaniel Nicandro
581aab10b6
jupyter-kernel-language: Change return value to be a symbol
This avoids interning a string for every method dispatch using the
jupyter-lang method specializer.
2019-03-07 22:51:25 -06:00
Nathaniel Nicandro
81ecc0ec31
jupyter-org--delete-unwrapped-result: Only attempt to delete valid elements
This avoids situations where a paragraph or headline context is deleted
whenever there is no whitespace after the #+RESULTS line and the element after
the #+RESULTS keyword is not a valid result.
2019-03-03 18:09:12 -06:00
Nathaniel Nicandro
8321f9c301
Preserve whitespace when wrapping result in a drawer 2019-03-03 17:55:23 -06:00
Nathaniel Nicandro
541e5dbe6d
jupyter-org--image-result: Let caller determine if image data is base64 encoded 2019-03-01 14:41:53 -06:00
Nathaniel Nicandro
f31b925ca3
jupyter-org-src-block: Fix typo 2019-02-28 12:59:04 -06:00
Nathaniel Nicandro
82dfe3e340 Re-organization 2019-02-22 08:33:00 -06:00