which-function-mode hangs with current python-mode and unbalanced quote marks

Bug #1235375 reported by James Troup
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
High
Andreas Roehler

Bug Description

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()

Revision history for this message
James Troup (elmo) wrote :
Changed in python-mode:
milestone: none → 6.1.3
assignee: nobody → Andreas Roehler (a-roehler)
importance: Undecided → Medium
Changed in python-mode:
status: New → In Progress
importance: Medium → High
Changed in python-mode:
status: In Progress → Fix Committed
Revision history for this message
Andreas Roehler (a-roehler) wrote :

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

Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.