mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00
Fix for issue #91
Corrected `ein:junk-new` to include kernelspec selection.
This commit is contained in:
parent
9fc8dd3be4
commit
7e4df981c8
2 changed files with 13 additions and 10 deletions
|
@ -50,20 +50,23 @@ format string which can be passed to `format-time-string'."
|
|||
'ein:junk-new)
|
||||
|
||||
;;;###autoload
|
||||
(defun ein:junk-new (name url-or-port)
|
||||
(defun ein:junk-new (name kernelspec url-or-port)
|
||||
"Open a notebook to try random thing.
|
||||
Notebook name is determined based on
|
||||
`ein:junk-notebook-name-template'.
|
||||
|
||||
When prefix argument is given, it asks URL or port to use."
|
||||
(interactive (let ((name (ein:junk-notebook-name))
|
||||
(url-or-port (or (ein:get-url-or-port)
|
||||
(ein:default-url-or-port))))
|
||||
(interactive (let* ((name (ein:junk-notebook-name))
|
||||
(url-or-port (or (ein:get-url-or-port)
|
||||
(ein:default-url-or-port)))
|
||||
(kernelspec (completing-read
|
||||
"Select kernel [default]: "
|
||||
(ein:list-available-kernels url-or-port) nil t nil nil "default" nil)))
|
||||
(setq name (read-string "Open notebook as: " name))
|
||||
(when current-prefix-arg
|
||||
(setq url-or-port (ein:notebooklist-ask-url-or-port)))
|
||||
(list name url-or-port)))
|
||||
(ein:notebooklist-new-notebook-with-name name url-or-port))
|
||||
(list name url-or-port)
|
||||
(ein:notebooklist-new-notebook-with-name name kernelspec url-or-port))))
|
||||
|
||||
|
||||
(define-obsolete-function-alias ' ein:notebook-rename-to-scratch-command
|
||||
|
|
|
@ -296,13 +296,13 @@ You may find the new one in the notebook list." error)
|
|||
(ein:notebooklist-open url-or-port no-popup))
|
||||
|
||||
;;;###autoload
|
||||
(defun ein:notebooklist-new-notebook-with-name (name &optional kernelspec url-or-port path)
|
||||
(defun ein:notebooklist-new-notebook-with-name (name kernelspec url-or-port &optional path)
|
||||
"Open new notebook and rename the notebook."
|
||||
(interactive (let* ((url-or-port (or (ein:get-url-or-port)
|
||||
(ein:default-url-or-port)))
|
||||
(kernelspec (completing-read
|
||||
"Select kernel [default]: "
|
||||
(ein:list-available-kernels url-or-port) nil t nil nil "default" nil))
|
||||
(kernelspec (completing-read
|
||||
"Select kernel [default]: "
|
||||
(ein:list-available-kernels url-or-port) nil t nil nil "default" nil))
|
||||
(name (read-from-minibuffer
|
||||
(format "Notebook name (at %s): " url-or-port))))
|
||||
(list name kernelspec url-or-port)))
|
||||
|
|
Loading…
Add table
Reference in a new issue