From daf96a9e05cb81b6f3f6b2932c6878db76bf9879 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 18 May 2013 15:47:37 -0400 Subject: set ipython as interpreter at some point in the past, I had trouble getting ipython set as the interpreter that I could send snippets of python files to. Now, however, it seems to be working nicely removing sys.exit keybinding because I was mostly using it in to limit what I was running from ipython, but shouldn't need to do that now --- init/km-python.el | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'init/km-python.el') diff --git a/init/km-python.el b/init/km-python.el index f5bbc85..9940611 100644 --- a/init/km-python.el +++ b/init/km-python.el @@ -1,7 +1,3 @@ -(defun km/python-sysexit () - (interactive) - (insert "sys.exit()")) - (defun km/python-shebang () (interactive) (km/shebang "python")) @@ -20,7 +16,19 @@ from colors import brew, fgry, bgry") (insert km/python-analysis-imports)) (defun km/python-hook () - (local-set-key (kbd "C-c p e") 'km/python-sysexit) (local-set-key (kbd "C-c p s") 'km/python-shebang) (local-set-key (kbd "C-c p a") 'km/python-insert-analysis-imports)) (add-hook 'python-mode-hook 'km/python-hook) + +;; http://www.emacswiki.org/emacs/PythonProgrammingInEmacs#toc5 +(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") -- cgit v1.2.3