Emacs hangs when using rope-goto-definition and rope-show-doc

249 Views Asked by At

I have installed ropemacs as part of the emacs-for-python collection of python development packages.

When I use the rope-goto-definition and rope-show-doc functions to goto/show library symbols I can more or less consistently get emacs to hang.

To enable introspection of libraries I added the following to $PROJECT_ROOT/.ropeproject/config.py:

VIRTUAL_ENV = "$HOME/.virtualenvs/$PROJECT_ROOT/"
ACTIVATE_FILE = VIRTUAL_ENV + "bin/activate_this.py"
execfile(ACTIVATE_FILE, dict(__file__=ACTIVATE_FILE))

It never seems to happen when jumping to project-local definitions, and not necessarily always when jumping to a library function. However, once I'm looking around in a library, it seems to consistently happen after one or two additional jumps. That said, I haven't really been able to identify a helpful pattern. Once emacs is hanging, the only thing I can do is to execute C-g a number of times, until emacs becomes responsive, and quickly kill the *Pymacs* buffer. If I'm too slow with doing that it freezes again. After having restarted Pymacs I have sometimes been able to jump to a symbol that previously made it freeze, but most of the time jumping to that same symbol will cause it to immediately freeze again. The python integration also seems to be slightly more unstable once I have restarted *Pymacs* once, at times hanging for no apparent reason other than me typing a few characters.

How could I proceed in debugging this?

I installed emacs-for-python from its git repository (rev. a5274). My emacs is from http://emacsformacosx.com/ and is at version 24.3.

EDIT: After having waited for more than fifteen minutes pymacs finally threw out an error. It was a permission error in $HOME/Library/Saved Application State/com.adobe.flashplayer.installmanager.savedState:

Opening [$HOME] project ... done pymacs-report-error: Python: OSError: [Errno 13] Permission denied: '$HOME/Library/Saved Application State/com

For some reason the directory was owned by root.

Now it seems like jumping to symbols always works, but often times it is very slow, as Iqbal Ansari suggests.

Investigating further I tried to compile the contents of the emacs-for-python installation directory (C-u 0 M-x byte-recompile-directory). It seems like it might have reduced the lookup time a little, but it's still incredibly slow at times.

What boggles me the most now is that the time it takes to jump to a definition is not consistent. The same jump, that sometimes finishes immediately, can, at other times, take several minutes.

0

There are 0 best solutions below