all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ian Zimmerman <itz@buug.org>
To: help-gnu-emacs@gnu.org
Subject: Re: python-mode's broken indentation behavior
Date: Sun, 28 Jun 2015 18:23:24 -0700	[thread overview]
Message-ID: <20150629011408.1789.2BEEC124@ahiker.mooo.com> (raw)
In-Reply-To: <87y4j37gzs.fsf@mid.deneb.enyo.de>

On 2015-06-28 21:47 +0200, Florian Weimer wrote:

> 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.

While I completely agree that this behavior is broken in both cases (and
I feel smug using emacs23, which doesn't do this), I thought it's worth
pointing out that these cases are quite different.  In the second case,
it is correct for the code to not unindent automatically, but it should
not restore the indent after you manually fix it.

Maybe you can just turn off the electric colon somehow?  If nothing
else, you should be able to do

(add-hook 'python-mode-hook
  (lambda ()
    (local-unset-key ":")))

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.




  reply	other threads:[~2015-06-29  1:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-28 19:47 python-mode's broken indentation behavior Florian Weimer
2015-06-29  1:23 ` Ian Zimmerman [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150629011408.1789.2BEEC124@ahiker.mooo.com \
    --to=itz@buug.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.