diff options
| author | Ravi R Kiran <aine.marina@gmail.com> | 2017-08-14 03:11:39 (GMT) |
|---|---|---|
| committer | Ravi R Kiran <aine.marina@gmail.com> | 2017-08-14 03:11:39 (GMT) |
| commit | caea74ad85a01f848299615546ea99403d528099 (patch) | |
| tree | c39d6cf6e2ea0eb0aeb0a6acf6e12052c192934e /lisp | |
| parent | b0eaab18db719c842e1e4cb00f4fe70f01753af9 (diff) | |
| download | dotemacs-caea74ad85a01f848299615546ea99403d528099.zip dotemacs-caea74ad85a01f848299615546ea99403d528099.tar.gz dotemacs-caea74ad85a01f848299615546ea99403d528099.tar.bz2 | |
Support for new ipython
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ravi-init-python.el | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/lisp/ravi-init-python.el b/lisp/ravi-init-python.el index 70118f7..100b448 100644 --- a/lisp/ravi-init-python.el +++ b/lisp/ravi-init-python.el @@ -31,8 +31,9 @@ (progn (add-hook 'python-mode-hook 'ravi/python-mode-hook) - (defun ravi/python-mode-hook() - ;; Set ipython as our interpreter + + (defun ravi/old-ipython-setup () + "Set up ipython interpreter for version less than 4, which works with readline" (setq python-shell-interpreter "ipython" python-shell-interpreter-args "--pylab" python-shell-prompt-regexp "In \\[[0-9]+\\]: " @@ -43,13 +44,23 @@ "';'.join(module_completion('''%s'''))\n" python-shell-completion-string-code "';'.join(get_ipython().Completer.all_completions('''%s'''))\n" - ) - - ;; For ipython 0.10, uncomment the following: - ;; (setq python-shell-completion-string-code - ;; "';'.join(__IP.complete('''%s'''))\n" - ;; python-shell-completion-module-string-code "" - ;; ) + )) + (defun ravi/ipython-5p4plus-setup () + "Set up ipython interpreter for version 5.4+ which requires rlipython to be installed" + (setq python-shell-interpreter "ipython" + python-shell-interpreter-args "--pylab --TerminalIPythonApp.interactive_shell_class=rlipython.TerminalInteractiveShell" + 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" + )) + (defun ravi/python-mode-hook() + ;; Set ipython as our interpreter + (ravi/old-ipython-setup) (when (functionp 'helm-dash) (setq-local helm-dash-docsets '("Python 2" "NumPy"))) |
