Skip to content

Commit 57306bf

Browse files
xor-xornnicandro
authored andcommitted
Make scratch buffers easier to identify
1 parent 7b64e18 commit 57306bf

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

jupyter-comm-layer.el

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ called if needed.")
112112

113113
(cl-defgeneric jupyter-comm-id ((comm jupyter-comm-layer))
114114
"Return an identification string for COMM.
115-
Can be used to identify this communication channel. For example,
116-
used in `jupyter-repl-scratch-buffer' to name the scratch
117-
buffer.")
115+
Can be used to identify this communication channel.")
118116

119117
(cl-defgeneric jupyter-event-handler (_obj _event)
120118
"Handle EVENT using OBJ."

jupyter-repl.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,8 +1653,9 @@ Return the buffer switched to."
16531653
(interactive)
16541654
(if (jupyter-repl-connected-p)
16551655
(let* ((client jupyter-current-client)
1656-
(name (format "*jupyter-scratch[%s]*"
1657-
(jupyter-comm-id (oref client kcomm)))))
1656+
(name (replace-regexp-in-string "^*jupyter-repl"
1657+
"*jupyter-scratch"
1658+
(buffer-name) (oref client buffer))))
16581659
(unless (get-buffer name)
16591660
(with-current-buffer (get-buffer-create name)
16601661
(funcall (jupyter-kernel-language-mode client))

0 commit comments

Comments
 (0)