diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-12-07 18:02:08 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-12-07 18:02:08 +0100 |
commit | b01ffaa37b5938e8e2576fa31362c14a5d9800de (patch) | |
tree | 85035fe46d3e8baa731f9635d23f8a4d760c9098 /lisp/init-python.el | |
parent | 6badc4c8d92f1d91222f02e2affce58b97e53d00 (diff) |
python: Fix ipython integration
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) |