From b01ffaa37b5938e8e2576fa31362c14a5d9800de Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Tue, 7 Dec 2021 18:02:08 +0100 Subject: python: Fix ipython integration --- lisp/init-python.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lisp/init-python.el') 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) -- cgit v1.2.3