Here are some notes on how to enable auto-completion for Emacs.
Following a recent post by John D Cook, I decided to try to enhance my default Emacs setup for Python (which barely consists in
ac-python and some custom hooks for indentation and tabs/spaces management). I should note that I am currently using standard Python shell as inferior process because I wasn’t able to configure Emacs to run ipython instead of standard Python. This may well be due to conflicting version of
ipython.el. With ipython.el from IPython distro, and the following in my
(require 'ipython) (setq ipython-command "/usr/local/bin/ipython") (setq py-python-command-args '("-pylab" "-colors" "LightBG"))
I seem to be able to send Python code to IPython, though.
a Python auto-completion package for Emacs. It aims at helping your Python coding in a non-destructive way. It also helps you to find information about Python objects, such as docstring, function arguments and code location.
For the Python part, we just need to install
% sudo pip install epc % sudo pip install jedi
(I’m still using Apple Python, which actually is Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05).)
And, for Emacs, provided we are using package.el, we just have to
M-x package-list-packages and then install
jedi. My package archives include http://melpa.milkbox.net/packages/ which generally provides more up to date packages. I added the following to my
(require 'epc) (setq jedi:setup-keys t) (setq jedi:server-command '("python" "~/.emacs.d/elpa/jedi-20130210.1518/jediepcserver.py")) (setq jedi:tooltip-method '(pos-tip)) (autoload 'jedi:setup "jedi" nil t) (add-hook 'python-mode-hook 'jedi:setup)
Below are some screenshots of
jedi.el in action: