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
Nathaniel Nicandro
960372d344
Add documentation about :display in jupyter-org-result
2019-02-22 08:31:00 -06:00
Nathaniel Nicandro
f7df9cb9cf
Allow table results to be suppressed by ":results scalar"
2019-02-22 08:29:00 -06:00
UndeadKernel
92d1d661c9
feature: Specify mime precedence using ":display" in org source blocks ( #17 )
...
A BEGIN_SRC block can specify which mime type to display by enabling the
user to manually set the priority order of mime types.
e.g.: In the following, :text/plain will be used before considering :text/html
#+BEGIN_SRC jupyter-python :display plain html
2019-02-22 07:56:22 -06:00
Nathaniel Nicandro
e357166371
Add jupyter-org-insert-element
2019-02-21 17:14:59 -06:00
Nathaniel Nicandro
70f4b1b9a3
jupyter-org--append-stream-result: Consider org-edit-src-content-indentation
2019-02-21 17:14:59 -06:00
Nathaniel Nicandro
7d72673604
Account for changes in org-mode
9.2
...
See #36 . There were some assumptions being made on how `org-mode` interpreted
`fixed-width` elements which were changes in `org-mode` 9.2.
2019-02-21 17:14:59 -06:00
Nathaniel Nicandro
b1af59cbf3
jupyter-org--stream-context-p: Consider an empty drawer
2019-02-21 08:14:09 -06:00
Nathaniel Nicandro
de289fc90b
jupyter-org--add-result: Better doc string
2019-02-20 18:42:09 -06:00
Nathaniel Nicandro
ea5ae74c1d
Don't rely on temporarily clearing :file header argument
...
Attempt at #16 .
2019-02-20 13:34:10 -06:00