With current python-mode (r1334), 'which-function-mode' can hang if
quote marks become unbalanced. Below is an example file with which I
can reproduce the problem. If I switch back to the version of the
python-mode shipped with Ubuntu (Saucy), I can no longer reproduce the
problem.
| #!/usr/bin/python
|
| def main():
| print "If you M-x which-funtion-mode and then delete the last character on this line, emacs will hang... "
| df = df.rename(columns={"%h": "IP", "%l": "Logname", "%u": "Username",
| "%t": "Time", "%r": "Request", "%>s": "Status",
| "%O": "Bytes sent", "%{Referer}i": "Referer",
| "%{User-Agent}i": "User Agent"})
|
|
| if __name__ == "__main__":
| main()
It should raise an error now, not hang. Mode-specific move-commands as underlying which-func need syntax, there is no way to make these work if syntax is broken.
Using an electric-paren mode should be a way to work around.
Thanks for the report,
Andreas