summaryrefslogtreecommitdiff
path: root/init/km-python.el
diff options
context:
space:
mode:
authorKyle Meyer <meyerkya@gmail.com>2013-05-18 15:47:37 -0400
committerKyle Meyer <meyerkya@gmail.com>2013-05-18 15:47:37 -0400
commitdaf96a9e05cb81b6f3f6b2932c6878db76bf9879 (patch)
treeb5ba219a5a79553437ae654976748894f20c514d /init/km-python.el
parent7ce18e3657af085cd407309854ed13223c0e0c98 (diff)
downloademacs.d-daf96a9e05cb81b6f3f6b2932c6878db76bf9879.tar.gz
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
Diffstat (limited to 'init/km-python.el')
-rw-r--r--init/km-python.el18
1 files changed, 13 insertions, 5 deletions
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")