GNU bug report logs - #20560
24.5; I am not happy with the new Python mode indentation behaviour

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Fabrice Salvaire <fabrice.salvaire@HIDDEN>; merged with #19906, #20742; dated Tue, 12 May 2015 15:44:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Merged 19906 20560 20742. Request was from fgallina@HIDDEN (Fabián Ezequiel Gallina) to control <at> debbugs.gnu.org. Full text available.
Merged 20560. Request was from fgallina@HIDDEN (Fabián Ezequiel Gallina) to control <at> debbugs.gnu.org. Full text available.

Message received at 20560 <at> debbugs.gnu.org:


Received: (at 20560) by debbugs.gnu.org; 12 May 2015 16:06:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 12 12:06:43 2015
Received: from localhost ([127.0.0.1]:42561 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YsChe-00036a-8B
	for submit <at> debbugs.gnu.org; Tue, 12 May 2015 12:06:42 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:57160 ident=Debian-exim)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rgm@HIDDEN>) id 1YsChb-00036R-Gq
 for 20560 <at> debbugs.gnu.org; Tue, 12 May 2015 12:06:40 -0400
Received: from rgm by fencepost.gnu.org with local (Exim 4.71)
 (envelope-from <rgm@HIDDEN>)
 id 1YsCha-0002hI-I6; Tue, 12 May 2015 12:06:38 -0400
From: Glenn Morris <rgm@HIDDEN>
To: Fabrice Salvaire <fabrice.salvaire@HIDDEN>
Subject: Re: bug#20560: 24.5;
 I am not happy with the new Python mode indentation behaviour
References: <5551D233.1090202@HIDDEN>
X-Spook: UFO HAMASMOIS SP4 Aldergrove Commecen jihad Noriega Putin
X-Ran: 6<Jex,P%d^1!!AJ1?W=PkGPa'TV2P`cZ?kOrwXe][%ghh3<O~7WiCw]ugK1g]GgT35t:BB
X-Hue: cyan
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Tue, 12 May 2015 12:06:38 -0400
In-Reply-To: <5551D233.1090202@HIDDEN> (Fabrice Salvaire's message of "Tue, 
 12 May 2015 12:13:07 +0200")
Message-ID: <mnwq0dzsoh.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 20560
Cc: 20560 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Fabrice Salvaire wrote:

> my_list = [
> ____1, 2, 3,
> ____4, 5, 6,
> ]

When I type that, I get an error, so perhaps it is not intended:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  =(nil 5)
  python-syntax-closing-paren-p()
  (and (python-syntax-closing-paren-p) (progn (forward-char 1) (not (nth 1 (or nil (syntax-ppss))))))
  (if (and (python-syntax-closing-paren-p) (progn (forward-char 1) (not (nth 1 (or nil (syntax-ppss)))))) (progn (cons :inside-paren-at-closing-paren start)))
  (save-excursion (skip-syntax-forward " ") (if (and (python-syntax-closing-paren-p) (progn (forward-char 1) (not (nth 1 (or nil (syntax-ppss)))))) (progn (cons :inside-paren-at-closing-paren start))))

> automatically, but I would prefer manual indentation than to fight
> against my editor.

Sounds like you want to turn off electric-indent-mode.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20560; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 May 2015 15:43:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 12 11:43:15 2015
Received: from localhost ([127.0.0.1]:42544 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YsCKw-0000zK-8e
	for submit <at> debbugs.gnu.org; Tue, 12 May 2015 11:43:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39722)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <fabrice.salvaire@HIDDEN>) id 1Ys7Bg-0007zo-VG
 for submit <at> debbugs.gnu.org; Tue, 12 May 2015 06:13:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <fabrice.salvaire@HIDDEN>) id 1Ys7Ba-0003Iw-Uo
 for submit <at> debbugs.gnu.org; Tue, 12 May 2015 06:13:15 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:37886)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <fabrice.salvaire@HIDDEN>) id 1Ys7Ba-0003Is-SQ
 for submit <at> debbugs.gnu.org; Tue, 12 May 2015 06:13:14 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53227)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <fabrice.salvaire@HIDDEN>) id 1Ys7BZ-00024p-Pj
 for bug-gnu-emacs@HIDDEN; Tue, 12 May 2015 06:13:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <fabrice.salvaire@HIDDEN>) id 1Ys7BW-0003Hm-IP
 for bug-gnu-emacs@HIDDEN; Tue, 12 May 2015 06:13:13 -0400
Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:58956
 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <fabrice.salvaire@HIDDEN>) id 1Ys7BW-0003H4-Ax
 for bug-gnu-emacs@HIDDEN; Tue, 12 May 2015 06:13:10 -0400
Received: from salus.localdomain ([213.41.136.101]) by mwinf5d50 with ME
 id SyD71q00F2BSCth03yD8vb; Tue, 12 May 2015 12:13:08 +0200
X-ME-Helo: salus.localdomain
X-ME-Auth: ZmFicmljZS5zYWx2YWlyZUB3YW5hZG9vLmZy
X-ME-Date: Tue, 12 May 2015 12:13:08 +0200
X-ME-IP: 213.41.136.101
Message-ID: <5551D233.1090202@HIDDEN>
Date: Tue, 12 May 2015 12:13:07 +0200
From: Fabrice Salvaire <fabrice.salvaire@HIDDEN>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
 rv:31.0) Gecko/20100101 Thunderbird/31.6.0
MIME-Version: 1.0
To: bug-gnu-emacs@HIDDEN
Subject: 24.5; I am not happy with the new Python mode indentation behaviour
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 12 May 2015 11:43:12 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Dear Emacs devs,

I noticed after an Emacs update the Python mode changed its indentation 
behaviour.

I checked my .emacs and .gnu-emacs-custion for settings that could 
interfere with the Python mode, but I found anything.

First it imposes a newer indentation style, the closing 
brace/bracket/parenthesis on multi-line constructs line up under the 
first character of the line that starts the multi-line construct:

my_list = [
____1, 2, 3,
____4, 5, 6,
]

while I have thousands lines of codes typed on Emacs where  the closing 
character is indented, e.g.:

my_list = [
____1, 2, 3,
____4, 5, 6,
____]

Moreover if you press enter in the following construct at the location 
marked by *  to add an empty line or to add codes after the if:

if foo:
____a = 1
*a = 2

then the line is automatically indented:

if foo:
____a = 1

____a = 2

Thus I have to fight continuously with the indentation and it will 
probably increase the indentation noise in the VCS.

I guess Python is not the most easier language to indent automatically, 
but I would prefer manual indentation than to fight against my editor.

Sincerely yours,

Fabrice





Acknowledgement sent to Fabrice Salvaire <fabrice.salvaire@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#20560; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 6 Jul 2015 02:30:05 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.