From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70617: 30.0.50; python-indent-shift-right indents left when line is whitespace Date: Mon, 29 Apr 2024 15:55:13 +0300 Message-ID: <861q6os4zy.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40582"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70617@debbugs.gnu.org To: Patrick Poitras , kobarity Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 29 14:55:50 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s1QXu-000AM8-RI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Apr 2024 14:55:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1QXp-0002rs-Sp; Mon, 29 Apr 2024 08:55:45 -0400 Original-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 1s1QXo-0002ri-FH for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2024 08:55:44 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1QXm-0007qe-P2 for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2024 08:55:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s1QY6-0002HQ-Lt for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2024 08:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2024 12:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70617 X-GNU-PR-Package: emacs Original-Received: via spool by 70617-submit@debbugs.gnu.org id=B70617.17143953488758 (code B ref 70617); Mon, 29 Apr 2024 12:56:02 +0000 Original-Received: (at 70617) by debbugs.gnu.org; 29 Apr 2024 12:55:48 +0000 Original-Received: from localhost ([127.0.0.1]:57132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1QXs-0002HC-4V for submit@debbugs.gnu.org; Mon, 29 Apr 2024 08:55:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1QXq-0002H6-HR for 70617@debbugs.gnu.org; Mon, 29 Apr 2024 08:55:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1QXR-0007jp-5t; Mon, 29 Apr 2024 08:55:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=eCxvdFaJmRdU+RDW5kJoF9BUs2FWYmIwdwWp6i1z5H0=; b=UOk5nEMYFuKg S5oBjSkCz4fNa8h81FeK5y20pL/PMsBxb1Y4FEk1Ig3o2N7hve4DCDDO3yadUKXIAa/SErKFYgZdh b4LfVwGBIEbmkqJS0m2FZ91zYr/8ZN3DAUyqX3uUG9/bg5uCaHxukFl6IBukEUZ4xSiyhxYQhjBcA MV56NRWPR4zaQEGNqrma+6yqhWDHEthMEV9sG8gI0u2CzCH5ntbkOyVIzrft9mRoKPLmqt32cb+0z zhBxjIhiv6LpLqAgQhOjGakIbiLeyQubvX2teJQbhQO2nCQogTe2nx07/AXx3BmEfjCL8lFyTkIX4 1yRlmF+9XDs2/H41T46G6A==; In-Reply-To: (message from Patrick Poitras on Sat, 27 Apr 2024 16:16:46 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284146 Archived-At: > From: Patrick Poitras > Date: Sat, 27 Apr 2024 16:16:46 -0700 > > Hi all. > > I've noticed this weird behavior of python-indent-shift-right. > > Let's say I have a block of code. The "|" character represents my cursor > > In a python file, I write > > if True: > | > > (... file contents continue) > > and then call python-indent-shift-right on an empty line. It does nothing. If the second line has any amount of > spaces, the whitespace is entirely deleted. > > Given that Python's whitespace is syntactically significant, the expected behavior should be to add an indent > to an empty line, or to prepend 4 characters (or 8, given user choice) to the empty line if it has whitespace. > From a cursory glance, I think we're running into some behavior of indent-rigidly that tries to prevent the > addition of superfluous white space following an indented block of code. I assume this would be potentially > desirable for languages with non-significant whitespace, but in the case of the python-specific function, the > resulting behavior defies both the function name and description. Any comments?