Extract ipython/jupyter arglist to variables

Also fixes #1022 by removing default --pylab arg from
+python/open-ipython-repl.
This commit is contained in:
Henrik Lissner 2018-12-05 14:31:02 -05:00
parent 553cee5921
commit 4455dc8baa
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 10 additions and 2 deletions

View file

@ -27,7 +27,7 @@
"Open an IPython REPL."
(interactive)
(let ((python-shell-interpreter "ipython")
(python-shell-interpreter-args "-i --pylab --simple-prompt --no-color-info"))
(python-shell-interpreter-args +python-jupyter-repl-args))
(+python/repl)))
;;;###autoload
@ -36,7 +36,7 @@
(interactive)
(add-to-list 'python-shell-completion-native-disabled-interpreters "jupyter")
(let ((python-shell-interpreter "jupyter")
(python-shell-interpreter-args "console --simple-prompt"))
(python-shell-interpreter-args (format "console %s" +python-jupyter-repl-args)))
(+python/repl)))
(defun +python--extract-version (prefix str)

View file

@ -3,6 +3,14 @@
(defconst +python-mode-line-indicator '("" +python--version)
"Format for the python version/env indicator in the mode-line.")
(defvar +python-ipython-repl-args "-i --simple-prompt --no-color-info"
"CLI arguments to initialize ipython with when `+python/open-ipython-repl' is
called.")
(defvar +python-jupyter-repl-args "--simple-prompt"
"CLI arguments to initialize 'jupiter console %s' with when
`+python/open-ipython-repl' is called.")
(defvar-local +python--version nil
"The python version in the current buffer.")