From 9185da824c3fdee67441f2ad836e592d7b27ae4f Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 6 Oct 2018 00:25:50 -0400 Subject: [PATCH] lang/python: remove +ipython flag + Replace +ipython functionality with +python/open-ipython-repl command. + Use python-shell-interpreter for eval handlers, repl and python version detection. + Removed various python-shell-* variables for ipython; they are already supported upstream. --- modules/lang/python/autoload/python.el | 4 +++- modules/lang/python/config.el | 15 ++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/modules/lang/python/autoload/python.el b/modules/lang/python/autoload/python.el index 73072dc83..c972da568 100644 --- a/modules/lang/python/autoload/python.el +++ b/modules/lang/python/autoload/python.el @@ -60,7 +60,9 @@ started it." (+python--extract-version "Pipenv " v) +python-version-cache)) (puthash (or (doom-project-root) default-directory) - (+python--extract-version "Python " (car (process-lines "python" "--version"))) + (+python--extract-version + "Python " + (car (process-lines python-shell-intepreter "--version"))) +python-version-cache)) (error "Python"))) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index f23c48975..14ee8fc82 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -14,18 +14,7 @@ :defer t :init (setq python-environment-directory doom-cache-dir - python-indent-guess-indent-offset-verbose nil - python-shell-interpreter "python") - (when (featurep! +ipython) - (setq python-shell-interpreter "ipython" - python-shell-interpreter-args "-i --simple-prompt --no-color-info" - python-shell-prompt-regexp "In \\[[0-9]+\\]: " - python-shell-prompt-block-regexp "\\.\\.\\.\\.: " - python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: " - python-shell-completion-setup-code - "from IPython.core.completerlib import module_completion" - python-shell-completion-string-code - "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")) + python-indent-guess-indent-offset-verbose nil) :config (set-env! "PYTHONPATH" "PYENV_ROOT" "ANACONDA_HOME") (set-electric! 'python-mode :chars '(?:)) @@ -131,7 +120,7 @@ :init (setq pipenv-with-projectile nil) :config (set-eval-handler! 'python-mode - '((:command . "python") + '((:command . (lambda () python-shell-interpreter)) (:exec (lambda () (if-let* ((bin (executable-find "pipenv")) (_ (pipenv-project-p)))