diff --git a/jupyter-comm-layer.el b/jupyter-comm-layer.el index eb4a409..caf40d4 100644 --- a/jupyter-comm-layer.el +++ b/jupyter-comm-layer.el @@ -112,9 +112,7 @@ called if needed.") (cl-defgeneric jupyter-comm-id ((comm jupyter-comm-layer)) "Return an identification string for COMM. -Can be used to identify this communication channel. For example, -used in `jupyter-repl-scratch-buffer' to name the scratch -buffer.") +Can be used to identify this communication channel.") (cl-defgeneric jupyter-event-handler (_obj _event) "Handle EVENT using OBJ." diff --git a/jupyter-repl.el b/jupyter-repl.el index e7e4180..c9ee0e1 100644 --- a/jupyter-repl.el +++ b/jupyter-repl.el @@ -1653,8 +1653,9 @@ Return the buffer switched to." (interactive) (if (jupyter-repl-connected-p) (let* ((client jupyter-current-client) - (name (format "*jupyter-scratch[%s]*" - (jupyter-comm-id (oref client kcomm))))) + (name (replace-regexp-in-string "^*jupyter-repl" + "*jupyter-scratch" + (buffer-name) (oref client buffer)))) (unless (get-buffer name) (with-current-buffer (get-buffer-create name) (funcall (jupyter-kernel-language-mode client))