How can I use meta-dot (M-.) in python with emacs?

nunb picture nunb · Aug 17, 2010 · Viewed 9.6k times · Source

Is there an equivalent of slime for python?

For example, if I position the cursor on foo() and do M-. (jump to definition) I would like to see the source definition of the function foo

This should work regardless of whether foo is in

1) the local project directory

2) in some ~/.virtualenvs/bar/lib/site-packages

3) in some other python-path

4) virtual env is in use (ie, it should look in my current virtualenv)

Does the pymacs/ropemacs combination do any of this?

Answer

mathk picture mathk · Aug 17, 2010

To avoid the -e you can use etags and with a find you recursively add the py file:

find . -type f -name '*.py' | xargs etags