mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
jupyter-generate-request (jupyter-org-client): Consider babel-call
org elements
Fixes #154.
This commit is contained in:
parent
66c794964c
commit
11b293438d
2 changed files with 21 additions and 1 deletions
|
@ -124,7 +124,8 @@ See also the docstring of `org-image-actual-width' for more details."
|
|||
(save-excursion
|
||||
(goto-char org-babel-current-src-block-location)
|
||||
(let* ((context (org-element-context))
|
||||
(block-params (nth 2 (org-babel-get-src-block-info nil context)))
|
||||
(block-params (nth 2 (or (org-babel-get-src-block-info nil context)
|
||||
(org-babel-lob-get-info context))))
|
||||
(result-params (alist-get :result-params block-params)))
|
||||
(jupyter-org-request
|
||||
:marker (copy-marker org-babel-current-src-block-location)
|
||||
|
|
|
@ -2759,6 +2759,25 @@ publish_display_data({'text/plain': \"foo\", 'text/latex': \"$\\alpha$\"});"
|
|||
": foo\n"
|
||||
:display "plain"))
|
||||
|
||||
(ert-deftest org-babel-jupyter-babel-call ()
|
||||
:tags '(org babel)
|
||||
(jupyter-org-test
|
||||
(insert (format "\
|
||||
#+NAME: foo
|
||||
#+begin_src jupyter-python :async yes :session %s
|
||||
1 + 1
|
||||
#+end_src
|
||||
|
||||
" jupyter-org-test-session))
|
||||
(insert "
|
||||
#+CALL: foo()")
|
||||
(org-ctrl-c-ctrl-c)
|
||||
(beginning-of-line)
|
||||
(jupyter-wait-until-idle (jupyter-org-request-at-point))
|
||||
(goto-char (org-babel-where-is-src-block-result))
|
||||
(forward-line)
|
||||
(should (looking-at-p ": 2\n"))))
|
||||
|
||||
;; Local Variables:
|
||||
;; byte-compile-warnings: (unresolved obsolete lexical)
|
||||
;; eval: (and (functionp 'aggressive-indent-mode) (aggressive-indent-mode -1))
|
||||
|
|
Loading…
Add table
Reference in a new issue