From f466b3adccf26ece5b94582b0de9b6f46f8cf398 Mon Sep 17 00:00:00 2001 From: Nathaniel Nicandro Date: Sun, 4 Feb 2018 18:19:08 -0600 Subject: [PATCH] [WIP] Better support for display-data messages --- jupyter-repl-client.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jupyter-repl-client.el b/jupyter-repl-client.el index 3e64495..29887e2 100644 --- a/jupyter-repl-client.el +++ b/jupyter-repl-client.el @@ -913,9 +913,17 @@ lines then truncate it to something less than req data _metadata - _transient) + transient) (jupyter-repl-do-at-request client req - (jupyter-repl-insert-data data))) + (cl-destructuring-bind (&key display_id &allow-other-keys) + transient + (if display_id + ;; TODO: More general display of output types. Follow the notebook + ;; convention, and have buffers or regions of the REPL dedicated to + ;; errors. Use an overlay to display errors in the REPL buffer. + (with-jupyter-repl-doc-buffer (format "display-%d" display_id) + (jupyter-repl-insert-data data)) + (jupyter-repl-insert-data data))))) (cl-defmethod jupyter-handle-status ((client jupyter-repl-client) _req execution-state) (oset client execution-state execution-state))