mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-04 15:41:37 -05:00
org-babel-jupyter-scratch-buffer: Don't switch buffers when inside edit buffer
This commit is contained in:
parent
f3b94bab39
commit
1913da83fa
2 changed files with 5 additions and 2 deletions
|
@ -1633,7 +1633,8 @@ in the appropriate direction, to the saved element."
|
|||
;;; `jupyter-repl-mode'
|
||||
|
||||
(defun jupyter-repl-scratch-buffer ()
|
||||
"Display a scratch buffer associated with the current REPL buffer."
|
||||
"Switch to a scratch buffer connected to the current REPL in another window.
|
||||
Return the buffer switched to."
|
||||
(interactive)
|
||||
(if (jupyter-repl-connected-p)
|
||||
(let* ((client jupyter-current-client)
|
||||
|
|
|
@ -256,12 +256,14 @@ the host."
|
|||
(if (equal session "none") (error "Need a session to run")
|
||||
(org-babel-jupyter-initiate-session-by-key session params)))
|
||||
|
||||
;;;###autoload
|
||||
(defun org-babel-jupyter-scratch-buffer ()
|
||||
"Display a scratch buffer connected to the current block's session."
|
||||
(interactive)
|
||||
(let (buffer)
|
||||
(org-babel-do-in-edit-buffer
|
||||
(setq buffer (jupyter-repl-scratch-buffer)))
|
||||
(setq buffer (save-window-excursion
|
||||
(jupyter-repl-scratch-buffer))))
|
||||
(if buffer (pop-to-buffer buffer)
|
||||
(user-error "No source block at point"))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue