From unknown Sat Aug 09 22:37:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#79187 <79187@debbugs.gnu.org> To: bug#79187 <79187@debbugs.gnu.org> Subject: Status: 30.1; Python mode indentation incorrect for multi-line "with" statements Reply-To: bug#79187 <79187@debbugs.gnu.org> Date: Sun, 10 Aug 2025 05:37:12 +0000 retitle 79187 30.1; Python mode indentation incorrect for multi-line "with"= statements reassign 79187 emacs submitter 79187 Tim Landscheidt severity 79187 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 05:50:01 2025 Received: (at submit) by debbugs.gnu.org; 7 Aug 2025 09:50:01 +0000 Received: from localhost ([127.0.0.1]:33704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ujxG4-0002tU-NF for submit@debbugs.gnu.org; Thu, 07 Aug 2025 05:50:00 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39676) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ujxG2-0002t0-Jb for submit@debbugs.gnu.org; Thu, 07 Aug 2025 05:49:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ujxFs-0000ok-Gf for bug-gnu-emacs@gnu.org; Thu, 07 Aug 2025 05:49:48 -0400 Received: from gavdos.tim-landscheidt.de ([2a01:4f8:1c0c:4bd6::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ujxFq-0003jP-G7 for bug-gnu-emacs@gnu.org; Thu, 07 Aug 2025 05:49:48 -0400 Received: from port-62-145-29-194.static.as20676.net ([62.145.29.194]:56918 helo=vagabond) by gavdos.tim-landscheidt.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ujxFj-003zgo-1l for bug-gnu-emacs@gnu.org; Thu, 07 Aug 2025 09:49:39 +0000 From: Tim Landscheidt To: bug-gnu-emacs@gnu.org Subject: 30.1; Python mode indentation incorrect for multi-line "with" statements Organization: https://www.tim-landscheidt.de/ X-Debbugs-Cc: Date: Thu, 07 Aug 2025 09:49:38 +0000 Message-ID: <87ms8bbgwd.fsf@vagabond.tim-landscheidt.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a01:4f8:1c0c:4bd6::1; envelope-from=tim@tim-landscheidt.de; helo=gavdos.tim-landscheidt.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) 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.