From 4455dc8baa349e7507aacd9f49355527b8cbd8f3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 5 Dec 2018 14:31:02 -0500 Subject: [PATCH] Extract ipython/jupyter arglist to variables Also fixes #1022 by removing default --pylab arg from +python/open-ipython-repl. --- modules/lang/python/autoload/python.el | 4 ++-- modules/lang/python/config.el | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/lang/python/autoload/python.el b/modules/lang/python/autoload/python.el index 69766e881..796223ccd 100644 --- a/modules/lang/python/autoload/python.el +++ b/modules/lang/python/autoload/python.el @@ -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) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 0f5077473..23cadc948 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -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.")