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

Full log


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.