Set python-shell-* vars early

To make it easier for users to overwrite them in thir config.el (without
an after! block).
This commit is contained in:
Henrik Lissner 2018-10-03 00:05:45 -04:00
parent b573fcce20
commit 7f1b526f64
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -16,6 +16,16 @@
(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"))
:config
(set-env! "PYTHONPATH" "PYENV_ROOT" "ANACONDA_HOME")
(set-electric! 'python-mode :chars '(?:))
@ -45,17 +55,6 @@
sp-point-after-word-p
sp-point-before-same-p)))
(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"))
(setq-hook! 'python-mode-hook tab-width python-indent-offset)
;; Add python/pipenv version string to the major mode in the modeline