Is it possible to make Python etags smarter with emacs?

I am working on my Django project with emacs. In my virtualenv "postactivate" script, I have the following simple command:

find -L . -type f -name "*.py" | xargs etags -e > /dev/null 2>&1 & 

The TAGS file is generated just fine, but the system seems pretty dumb. When the cursor is a call to a model filter, for example

 MyModel.objects.filter(...) 

and I find M-. sometimes emacs takes me to where MyModel is imported during the file (the actual import statement). I just want to attend class, method, and function definitions.

Is there a way to make etags smarter?

Thanks Ryan Kaskel

+7
python django emacs tags
source share
1 answer

Getting the right modular analysis using a language like python is very difficult, due to its dynamic nature, the best way to get the right information is through static analysis or heuristics.

Currently, the best I have found is learning methods with the ropemacs extension, which has great features like code help (pretty smart) and calltips.

Unfortunately, with ropemacs it is not so simple, you have to install the first pymacs and then set up different rope libraries. (I am working on a packaged version )

Another package that will statically analyze your Python code and create smart tags will look like pysmell , but I don’t know, t used it extensively

+3
source share

All Articles