diff options
Diffstat (limited to 'lisp/init-python.el')
-rw-r--r-- | lisp/init-python.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/init-python.el b/lisp/init-python.el index 022ef6e..f3b8498 100644 --- a/lisp/init-python.el +++ b/lisp/init-python.el @@ -15,9 +15,13 @@ :hook (python-mode . mpolden/python-mode-buffer-local-variables) :config ;; set prefered interpreter - (setq python-shell-interpreter (or (executable-find "ipython") - (executable-find "python3") - (executable-find "python")))) + (setq python-shell-interpreter (cond ((executable-find "ipython") "ipython") + ((executable-find "python3") "python3") + t "python")) + ;; ipython needs --simple-prompt for emacs compatibility + ;; https://emacs.stackexchange.com/a/24572 + (when (equal python-shell-interpreter "ipython") + (setq python-shell-interpreter-args "-i --simple-prompt"))) (provide 'init-python) |