From unknown Sun Aug 10 02:40:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79187: 30.1; Python mode indentation incorrect for multi-line "with" statements Resent-From: Tim Landscheidt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Aug 2025 09:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 79187 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79187@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175456020111132 (code B ref -1); Thu, 07 Aug 2025 09:50:02 +0000 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 Organization: https://www.tim-landscheidt.de/ 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-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.