mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
Remove the rest of the uses of jupyter-repl-same-lang-mode
This commit is contained in:
parent
82f0701a94
commit
d77f17be8f
1 changed files with 8 additions and 12 deletions
|
@ -1860,12 +1860,6 @@ purposes and SYNTAX-TABLE is the syntax table of MODE."
|
||||||
(setq syntax (syntax-table))))
|
(setq syntax (syntax-table))))
|
||||||
(list mode syntax))))
|
(list mode syntax))))
|
||||||
|
|
||||||
(defun jupyter-repl-same-lang-mode-p (client)
|
|
||||||
"Is BUFFER's `major-mode' the same as CLIENT's `jupyter-repl-lang-mode'?"
|
|
||||||
(let ((mode major-mode))
|
|
||||||
(with-jupyter-repl-buffer client
|
|
||||||
(eq jupyter-repl-lang-mode mode))))
|
|
||||||
|
|
||||||
(defun jupyter-repl--new-repl (client)
|
(defun jupyter-repl--new-repl (client)
|
||||||
"Initialize a new REPL buffer based on CLIENT.
|
"Initialize a new REPL buffer based on CLIENT.
|
||||||
CLIENT should be a `jupyter-repl-client' already connected to its
|
CLIENT should be a `jupyter-repl-client' already connected to its
|
||||||
|
@ -1932,15 +1926,15 @@ Otherwise, in a non-interactive call, return the
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun connect-jupyter-repl (file-or-plist &optional associate-buffer)
|
(defun connect-jupyter-repl (file-or-plist &optional associate-buffer)
|
||||||
"Run a Jupyter REPL connected to a kernel using a connection file.
|
"Run a Jupyter REPL using a kernel's connection FILE-OR-PLIST.
|
||||||
FILE-OR-PLIST can be either a file holding the connection
|
FILE-OR-PLIST can be either a file holding the connection
|
||||||
information or a PLIST of the connection information.
|
information or a property list of connection information.
|
||||||
|
|
||||||
ASSOCIATE-BUFFER has the same meaning as in `run-jupyter-repl'.
|
ASSOCIATE-BUFFER has the same meaning as in `run-jupyter-repl'.
|
||||||
|
|
||||||
When called interactively, display the newly created REPL buffer.
|
When called interactively, display the new REPL buffer.
|
||||||
Otherwise, in a non-interactive call return the newly created
|
Otherwise, in a non-interactive call return the
|
||||||
client connected to the REPL."
|
`jupyter-repl-client' connected to the kernel."
|
||||||
(interactive (list (read-file-name "Connection file: ") t))
|
(interactive (list (read-file-name "Connection file: ") t))
|
||||||
(let ((client (make-instance 'jupyter-repl-client)))
|
(let ((client (make-instance 'jupyter-repl-client)))
|
||||||
(jupyter-initialize-connection client file-or-plist)
|
(jupyter-initialize-connection client file-or-plist)
|
||||||
|
@ -1954,7 +1948,9 @@ client connected to the REPL."
|
||||||
(error "Kernel did not respond to kernel-info request"))
|
(error "Kernel did not respond to kernel-info request"))
|
||||||
(oset client kernel-info (jupyter-message-content info))
|
(oset client kernel-info (jupyter-message-content info))
|
||||||
(jupyter-repl--new-repl client)
|
(jupyter-repl--new-repl client)
|
||||||
(when (and associate-buffer (jupyter-repl-same-lang-mode-p client))
|
(when (and associate-buffer
|
||||||
|
(eq major-mode (with-jupyter-repl-buffer client
|
||||||
|
jupyter-repl-lang-mode)))
|
||||||
(jupyter-repl-associate-buffer client))
|
(jupyter-repl-associate-buffer client))
|
||||||
(if (called-interactively-p 'interactive)
|
(if (called-interactively-p 'interactive)
|
||||||
(pop-to-buffer (oref client buffer))
|
(pop-to-buffer (oref client buffer))
|
||||||
|
|
Loading…
Add table
Reference in a new issue