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.
This commit is contained in:
Henrik Lissner 2018-10-06 00:25:50 -04:00
parent 7c6e2e705f
commit 9185da824c
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 5 additions and 14 deletions

View file

@ -60,7 +60,9 @@ started it."
(+python--extract-version "Pipenv " v) (+python--extract-version "Pipenv " v)
+python-version-cache)) +python-version-cache))
(puthash (or (doom-project-root) default-directory) (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)) +python-version-cache))
(error "Python"))) (error "Python")))

View file

@ -14,18 +14,7 @@
:defer t :defer t
:init :init
(setq python-environment-directory doom-cache-dir (setq python-environment-directory doom-cache-dir
python-indent-guess-indent-offset-verbose nil 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"))
:config :config
(set-env! "PYTHONPATH" "PYENV_ROOT" "ANACONDA_HOME") (set-env! "PYTHONPATH" "PYENV_ROOT" "ANACONDA_HOME")
(set-electric! 'python-mode :chars '(?:)) (set-electric! 'python-mode :chars '(?:))
@ -131,7 +120,7 @@
:init (setq pipenv-with-projectile nil) :init (setq pipenv-with-projectile nil)
:config :config
(set-eval-handler! 'python-mode (set-eval-handler! 'python-mode
'((:command . "python") '((:command . (lambda () python-shell-interpreter))
(:exec (lambda () (:exec (lambda ()
(if-let* ((bin (executable-find "pipenv")) (if-let* ((bin (executable-find "pipenv"))
(_ (pipenv-project-p))) (_ (pipenv-project-p)))