diff --git a/jupyter-connection.el b/jupyter-connection.el index dc9fb73..6980d14 100644 --- a/jupyter-connection.el +++ b/jupyter-connection.el @@ -67,9 +67,6 @@ connected to.") (cl-defmethod jupyter-stop ((io function) &optional _channel) (jupyter-send io 'stop)) -(defun jupyter-conn-id (conn) - (funcall (jupyter-connection-id conn))) - ;;;; `jupyter-connection' (cl-defgeneric jupyter-connection (thing) diff --git a/jupyter-kernel.el b/jupyter-kernel.el index 18079af..f918ddb 100644 --- a/jupyter-kernel.el +++ b/jupyter-kernel.el @@ -49,6 +49,16 @@ "Return non-nil if KERNEL has been launched." (and (jupyter-kernel-session kernel) t)) +(cl-defmethod cl-print-object ((kernel jupyter-kernel) stream) + (princ (format "#" + (jupyter-kernelspec-name (jupyter-kernel-spec kernel)) + (if (jupyter-alive-p kernel) + (concat " " (truncate-string-to-width + (jupyter-session-id (jupyter-kernel-session kernel)) + 9 nil nil "…")) + "")) + stream)) + (cl-defgeneric jupyter-kernel (&rest args) "Return a kernel constructed from ARGS. ARGS are keyword arguments used to initialize the returned