GNU bug report logs - #79187
30.1; Python mode indentation incorrect for multi-line "with" statements

Previous Next

Package: emacs;

Reported by: Tim Landscheidt <tim <at> tim-landscheidt.de>

Date: Thu, 7 Aug 2025 09:50:02 UTC

Severity: normal

Found in version 30.1

To reply to this bug, email your comments to 79187 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79187; Package emacs. (Thu, 07 Aug 2025 09:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tim Landscheidt <tim <at> tim-landscheidt.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 07 Aug 2025 09:50:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tim Landscheidt <tim <at> tim-landscheidt.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.1; Python mode indentation incorrect for multi-line "with"
 statements
Date: Thu, 07 Aug 2025 09:49:38 +0000
https://docs.python.org/3/reference/compound_stmts.html#the-with-statement
allows for multi-item context managers in "with" statements
surrounded by parentheses:

| with (
|     A() as a,
|     B() as b,
| ):
|     SUITE

I. e., the context managers are indented to the same level
as the suite.

However, when entering the example above, Emacs 30.1/Fedora
41 indents it as:

| with (
|         A() as a,
|         B() as b,
|         ):
|     SUITE

I. e., the context managers are indented two levels instead
of one, and the closing parenthesis is indented two levels
instead of none.




This bug report was last modified 2 days ago.

Previous Next


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