From e50929e0331ad630a9be153a5b1cd86c2ae68490 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 14 Mar 2015 23:40:41 -0400 Subject: Simplify IPython shell setup Current python.el seems to have this built in. --- lisp/init-python.el | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'lisp/init-python.el') diff --git a/lisp/init-python.el b/lisp/init-python.el index 0b2c471..2eb4325 100644 --- a/lisp/init-python.el +++ b/lisp/init-python.el @@ -3,6 +3,8 @@ (setq jedi:tooltip-method nil ac-auto-start nil) +(setq python-shell-interpreter "ipython") + (add-to-list 'interpreter-mode-alist '("python2" . python-mode)) (add-to-list 'interpreter-mode-alist '("python3" . python-mode)) @@ -15,19 +17,11 @@ (set (make-local-variable 'compile-command) "py.test")) (add-hook 'python-mode-hook 'km/python-hook) -;; http://www.emacswiki.org/emacs/PythonProgrammingInEmacs#toc5 -(defun km/setup-ipython-shell () +(defun km/toggle-ipython-shell () + "Switch between using python and IPython for interactive shell." (interactive) - (setq python-shell-interpreter "ipython" - python-shell-interpreter-args "" - python-shell-prompt-regexp "In \\[[0-9]+\\]: " - python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: " - python-shell-completion-setup-code - "from IPython.core.completerlib import module_completion" - python-shell-completion-module-string-code - "';'.join(module_completion('''%s'''))\n" - python-shell-completion-string-code - "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")) + (setq python-shell-interpreter + (if (string= python-shell-interpreter "python") "ipython" "python"))) (defun km/find-python-test-file-other-window (arg) "Open test file for the current Python file in another window. -- cgit v1.2.3