3

I'm using elpy with emacs and python3. Here's the relevant part of my .emacs:

;; PYTHON
(elpy-enable)
(setq elpy-rpc-python-command "python3")
(elpy-use-ipython "ipython3")
(autoload 'jedi:setup "jedi" nil t)
(add-hook 'python-mode-hook 'jedi:setup)
(add-hook 'pyvenv-mode-hook 'jedi:setup)
(setq jedi:setup-keys t)
(setq jedi:complete-on-dot t)

Now, if I create a class in a python file, auto completion works perfectly. Then I try C-c C-c, and the class is loaded up in my ipython buffer, and I can play around with it. So far so good.

Unfortunatly, this is where I really want auto-complete, but my autocomplete experience here is a little unsatisfactory. Out of the box I can use tab to get completions in another window, but I'd like the "on dot popup" I get in python mode. Executuing jedi:setup gives me popups, but it's just builtins, and not my class methods.

How can I get the same auto complete behavior in my ipython rpc buffer as I get in my python editing buffer?

1 Answer 1

3

Elpy doesn't require emacs jedi package. Also they won't work well when both are configured. I guess there is some conflict between them.

Use only elpy and you should be able to get completion in rpc buffer.

I created an empty file with

class Foo:
    this = 2

After sending this to python buffer with C-C C-c, if i switch to python buffer and type Foo. it gives completions.

enter image description here

6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.