Raise an error when the current-buffer' has no REPL client in jupyter-repl-pop-to-buffer`

This commit is contained in:
Nathaniel Nicandro 2018-01-22 19:41:01 -06:00
parent ee69147b72
commit c80b62bdc6

View file

@ -1715,11 +1715,15 @@ Set the execution-count slot of `jupyter-repl-current-client' to
;;; `jupyter-repl-interaction-mode'
(defun jupyter-repl-pop-to-buffer ()
"Switch to the REPL buffer associated with `jupyter-repl-current-client'."
"Switch to the REPL buffer associated with the `current-buffer'.
Switch to the REPL buffer of the `jupyter-repl-current-client'
for the `current-buffer'."
(interactive)
(if jupyter-repl-current-client
(with-jupyter-repl-buffer jupyter-repl-current-client
(goto-char (point-max))
(pop-to-buffer (current-buffer))))
(pop-to-buffer (current-buffer)))
(error "Buffer not associated with a REPL, see `jupyter-repl-associate-buffer'")))
(defun jupyter-repl-available-repl-buffers (&optional mode)
"Get a list of REPL buffers that are connected to live kernels.