mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
Simplify adding results
This commit is contained in:
parent
0dec139a3a
commit
84cf20c863
1 changed files with 11 additions and 13 deletions
|
@ -480,22 +480,20 @@ PARAMS."
|
|||
:display-data
|
||||
(lambda (msg)
|
||||
(unless (eq result-type 'output)
|
||||
(funcall add-result (org-babel-jupyter-prepare-result
|
||||
(jupyter-message-get msg :data)
|
||||
(jupyter-message-get msg :metadata)
|
||||
params))))
|
||||
(cl-destructuring-bind (&key data metadata &allow-other-keys)
|
||||
(jupyter-message-content msg)
|
||||
(funcall add-result (org-babel-jupyter-prepare-result
|
||||
data metadata params)))))
|
||||
:execute-result
|
||||
(lambda (msg)
|
||||
(unless (eq result-type 'output)
|
||||
(funcall add-result (org-babel-jupyter-prepare-result
|
||||
(jupyter-message-get msg :data)
|
||||
(jupyter-message-get msg :metadata)
|
||||
params)))))
|
||||
(if async (format "%s%s"
|
||||
(if (member "raw" (alist-get :result-params params))
|
||||
": "
|
||||
"")
|
||||
(jupyter-request-id req))
|
||||
(cl-destructuring-bind (&key data metadata &allow-other-keys)
|
||||
(jupyter-message-content msg)
|
||||
(funcall add-result (org-babel-jupyter-prepare-result
|
||||
data metadata params))))))
|
||||
(if async
|
||||
(concat (when (member "raw" (alist-get :result-params params)) ": ")
|
||||
(jupyter-request-id req))
|
||||
(jupyter-wait-until-idle req most-positive-fixnum)
|
||||
;; Finalize the list of results
|
||||
(setq results (nreverse results))
|
||||
|
|
Loading…
Add table
Reference in a new issue