mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-04 15:41:37 -05:00
Make scratch buffers easier to identify
This commit is contained in:
parent
7b64e18144
commit
57306bf385
2 changed files with 4 additions and 5 deletions
|
@ -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."
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue