From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Florian Weimer Newsgroups: gmane.emacs.help Subject: Re: python-mode's broken indentation behavior Date: Mon, 29 Jun 2015 21:33:32 +0200 Message-ID: <87d20e5myb.fsf@mid.deneb.enyo.de> References: <87y4j37gzs.fsf@mid.deneb.enyo.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1435606519 21956 80.91.229.3 (29 Jun 2015 19:35:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Jun 2015 19:35:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 29 21:35:19 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z9epq-0002bn-IB for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 21:35:18 +0200 Original-Received: from localhost ([::1]:43719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9epp-0000gc-PD for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 15:35:17 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.unit0.net!news.uni-stuttgart.de!news.enyo.de!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-X-Trace: news.enyo.de 1435606412 16967 192.168.18.20 (29 Jun 2015 19:33:32 GMT) Original-X-Complaints-To: news@enyo.de Cancel-Lock: sha1:FHDlZt3lLRBPAzKr7uJFar0uNZE= Original-Xref: usenet.stanford.edu gnu.emacs.help:213008 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105294 Archived-At: * Ian Zimmerman: > 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. I wanted to show that incorrect re-indent happens in both cases, both for the unreachable case and the reachable case. I have no problem with automatic deindenting after a statement which causes an abnormal exit of the block.