From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Woodcraft Newsgroups: gmane.emacs.bugs Subject: bug#22663: 25.0.91; python.el electric-indent misbehaviour with 'except:' Date: Sun, 14 Feb 2016 17:13:18 +0000 Message-ID: <877fi7z041.fsf@golux.woodcraft.me.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1455470066 8152 80.91.229.3 (14 Feb 2016 17:14:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Feb 2016 17:14:26 +0000 (UTC) To: 22663@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 14 18:14:14 2016 Return-path: Envelope-to: geb-bug-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 1aV0FQ-0000uz-So for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 18:14:13 +0100 Original-Received: from localhost ([::1]:52171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV0FP-0005kp-QM for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 12:14:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV0FL-0005kc-G8 for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 12:14:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aV0FG-0002Mg-FG for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 12:14:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV0FG-0002MX-CD for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 12:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aV0FG-000169-8t for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 12:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Woodcraft Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Feb 2016 17:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22663 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14554700214185 (code B ref -1); Sun, 14 Feb 2016 17:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Feb 2016 17:13:41 +0000 Original-Received: from localhost ([127.0.0.1]:39000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aV0Ev-00015R-83 for submit@debbugs.gnu.org; Sun, 14 Feb 2016 12:13:41 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42779) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aV0Et-00015F-RS for submit@debbugs.gnu.org; Sun, 14 Feb 2016 12:13:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aV0En-0002L5-Tz for submit@debbugs.gnu.org; Sun, 14 Feb 2016 12:13:34 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:46690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV0En-0002L1-RV for submit@debbugs.gnu.org; Sun, 14 Feb 2016 12:13:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV0Em-0005fH-Ky for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 12:13:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aV0Eh-0002Kd-Mr for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 12:13:32 -0500 Original-Received: from hark.woodcraft.me.uk ([213.138.109.203]:33161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV0Eh-0002KT-Gn for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 12:13:27 -0500 Original-Received: from cpc92308-cmbg19-2-0-cust726.5-4.cable.virginm.net ([82.24.250.215] helo=golux.woodcraft.me.uk) by hark.woodcraft.me.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1aV0Ed-0005mr-Uj; Sun, 14 Feb 2016 17:13:23 +0000 Original-Received: from mjw by golux.woodcraft.me.uk with local (Exim 4.84) (envelope-from ) id 1aV0EY-0003VH-Mm; Sun, 14 Feb 2016 17:13:18 +0000 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113024 Archived-At: If I have the following code and add the colon after the 'ValueError', python.el's electric-indent helpfully dedents the 'except' line, but also indents the line below. def foo(): try: a = int(s) except ValueError bar(a) In practice this is never what I want to happen: if I'm adding try/except around part of an existing function, the existing lines after 'except' are for the non-exceptional case. (Seen in emacs 25.0.91; 24.5 is the same; checked with 'emacs -Q'.) In GNU Emacs 25.0.91.1 (i586-pc-linux-gnu, GTK+ Version 3.14.5) of 2016-02-14, modified by Debian built on golux Windowing system distributor 'The X.Org Foundation', version 11.0.11604000 System Description: Debian GNU/Linux 8.3 (jessie) Configured using: 'configure --build i586-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/25.0.91/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.0.91/site-lisp:/usr/share/emacs/site-lisp --build i586-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/25.0.91/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.0.91/site-lisp:/usr/share/emacs/site-lisp --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -fno-omit-frame-pointer' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LC_CTYPE: en_GB.UTF-8 locale-coding-system: utf-8-unix