py-electric-colon indents incorrect and leaves point at the wrong place
Bug #837065 reported by
Barry Warsaw
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Medium
|
Andreas Roehler |
Bug Description
-----snip snip-----
class TestJoin(
def tearDown(self):
def join_user_
-----snip snip-----
Put point after the paren on the last line and hit colon. The line is incorrectly indented to under the `reset_the_world()` line, and point is left on the `d` of `def`.
Related branches
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
milestone: | none → 6.0.3 |
importance: | Undecided → Medium |
Changed in python-mode: | |
status: | New → In Progress |
Changed in python-mode: | |
status: | In Progress → Fix Committed |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Hi Barry,
can't see the bug. Maybe we must negotiate what "electric" means or should mean in the context.
As Emacs can't know reliable what the wished indent will be, it can only guess. So electric indents to the outmost reasonable indent. It leaves point at the current-indent column, to enable a backspace.
Result here is:
class TestJoin( unittest. TestCase) :
reset_ the_world( )
def tearDown(self):
def join_user_ with_bogus_ id(self) :
After electric indent it ends up as above, BTW as you described.
So in the example given, if you don't want a further indent, don't call electric colon, but simple colon
C-u :
? :)
Cheers,
Andreas