all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* python-mode's broken indentation behavior
@ 2015-06-28 19:47 Florian Weimer
  2015-06-29  1:23 ` Ian Zimmerman
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Florian Weimer @ 2015-06-28 19:47 UTC (permalink / raw)
  To: help-gnu-emacs

Indentation in python-mode has been fairly broken for me, I believe
since Emacs 24.  The electric colon makes this especially annoying.

In the following, _ marks the position of point.

If I press RET here:

def foo(x):
    if x:
        return 2
    else:
        raise Foo_

I get this, which is correct.

def foo(x):
    if x:
        return 2
    else:
        raise Foo
    _

Continuing typing:

def foo(x):
    if x:
        return 2
    else:
        raise Foo
    for i in range(0, 10)_

So far, so good.  Now press ‘:’:

def foo(x):
    if x:
        return 2
    else:
        raise Foo
        for i in range(0, 10):_

Going from:

def foo(x):
    if x:
        x()
    else:
        y()
    for i in range(0, 10)_

to:

def foo(x):
    if x:
        x()
    else:
        y()
        for i in range(0, 10):_

is equally unhelpful.

For me, this makes editing Python scripts with Emacs a fairly painful
experience.

Surely this is a known issue because it has been around for so long.
Is this the behavior the python-mode maintainers prefer?  I find this
hard to believe.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-06-30 13:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-28 19:47 python-mode's broken indentation behavior Florian Weimer
2015-06-29  1:23 ` Ian Zimmerman
2015-06-29  1:31 ` Stefan Monnier
2015-06-29  2:55 ` Jude DaShiell
2015-06-29 19:29 ` John Mastro
     [not found] ` <mailman.5883.1435541016.904.help-gnu-emacs@gnu.org>
2015-06-29 19:33   ` Florian Weimer
     [not found] ` <mailman.5885.1435541477.904.help-gnu-emacs@gnu.org>
2015-06-29 19:42   ` Florian Weimer
2015-06-30 13:40     ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.