GNU bug report logs - #70617
30.0.50; python-indent-shift-right indents left when line is whitespace

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Patrick Poitras <patrick.f.poitras@HIDDEN>; Keywords: wontfix; Done: Eli Zaretskii <eliz@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 70617 <at> debbugs.gnu.org and Patrick Poitras <patrick.f.poitras@HIDDEN> Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) wontfix. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 70617 <at> debbugs.gnu.org:


Received: (at 70617) by debbugs.gnu.org; 9 May 2024 07:40:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 09 03:40:12 2024
Received: from localhost ([127.0.0.1]:53715 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s4yNv-0001eY-Fw
	for submit <at> debbugs.gnu.org; Thu, 09 May 2024 03:40:12 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59468)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>)
 id 1s4yNt-0001eN-OK; Thu, 09 May 2024 03:40:10 -0400
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 <eliz@HIDDEN>)
 id 1s4yNO-0004Il-FR; Thu, 09 May 2024 03:39:38 -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=DZelgYqmxEr3HFiT9QdNzHhADi/vD/ZyokmarwaSvd0=; b=ePQOGmaeA5aE
 OlUFXmtpc2Ao86paIkkbB7JOqpVWNEziYvcqDYIyNn6dyNeeTb7c9gQqm/9XqMNVsurMnB5ujeDhs
 yPcgxg7yWYmbZs9YGk8IGo6XStOaTRsmCkwJCkJqamLEm9D6rnR2cJ9CWJpyTktTaNKR/xmP0ereu
 HEwO0b9cGpD8SySY54pne4HNF4qFy240Pozw5hdC0R2Bt8ZppGvxi/agzayh8kA3S8Z6lTi7oNsTs
 zC4oh0ZChfcwZJD+9slr2h5C1Zrmd5l5gw75cC+x0L0l/V58IPo6l8jigaxYcjwnIDXtje626+7DO
 1AgdQvhMc+LdJJIEDlUv4w==;
Date: Thu, 09 May 2024 10:39:37 +0300
Message-Id: <86msoz77t2.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: kobarity <kobarity@HIDDEN>
In-Reply-To: <eke7mspb1fca.wl-kobarity@HIDDEN> (message from kobarity on
 Tue, 30 Apr 2024 16:26:13 +0900)
Subject: Re: bug#70617: 30.0.50;
 python-indent-shift-right indents left when line is whitespace
References: <CACpx+d6b9madXDzJz5Vb6KpxTTDeUkbOmW2RdNytZYfMr1qDyA@HIDDEN>
 <861q6os4zy.fsf@HIDDEN> <eke7mspb1fca.wl-kobarity@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70617
Cc: 70617 <at> debbugs.gnu.org, patrick.f.poitras@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

tags 70617 wontfix
close 70617
thanks

> Date: Tue, 30 Apr 2024 16:26:13 +0900
> From: kobarity <kobarity@HIDDEN>
> Cc: 70617 <at> debbugs.gnu.org
> 
> Eli Zaretskii wrote:
> > 
> > > From: Patrick Poitras <patrick.f.poitras@HIDDEN>
> > > 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?
> 
> Hi Patrick,
> 
> I believe this behavior is intended to avoid adding extra whitespaces
> when processing a region containing blank lines.  There may be an
> approach to change to indent even a blank line as a special case when
> the region is not active, but I personally think that Enter or TAB
> indentation is sufficient in such cases.

No further comments, so I'm now closing this bug as wontfix.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70617; Package emacs. Full text available.

Message received at 70617 <at> debbugs.gnu.org:


Received: (at 70617) by debbugs.gnu.org; 30 Apr 2024 07:27:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 03:27:02 2024
Received: from localhost ([127.0.0.1]:59147 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1htG-0002BI-G0
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 03:27:02 -0400
Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]:53537)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kobarity@HIDDEN>) id 1s1htD-0002Ar-1H
 for 70617 <at> debbugs.gnu.org; Tue, 30 Apr 2024 03:27:01 -0400
Received: by mail-pl1-x62e.google.com with SMTP id
 d9443c01a7336-1ec5387aed9so1052805ad.3
 for <70617 <at> debbugs.gnu.org>; Tue, 30 Apr 2024 00:26:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714461992; x=1715066792; darn=debbugs.gnu.org;
 h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from
 :message-id:date:from:to:cc:subject:date:message-id:reply-to;
 bh=deCFhUrwJFdWXmn9icl1qryo1c2Ck7AV4gufuoa8/6A=;
 b=OZhSFtCb4Ikg514jxjYoFCbPN7+QvC1sVxx6sMdK69yYnjDEJjXJaxGLurnQhZx6PJ
 aFPSVMOdLrPuIbWf+vFI7/XH3N6mhTDuG5oEvTAnNS8/6iMDutiyUzAiV/JQS0dWrN90
 J1D4LkOcln3TAnuMdJw+ghoLKxzhS1D/+gpqihz5p6KfQdUl+CC1yH6JZ6UkGRxrpKvp
 MHV8/Rkc7ysrw3XGe4keQnUcuvcL6jwhw8IWzLn+YMpgNU7zuGngL29yzbvNrSvng3E9
 L0FNS/tKcxVnjdMWgP4pkTdXl1UtT8ymXPoTdMIjtPyLFP0rFh+Xtwpw2MiVJmIPj4NL
 KhJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714461992; x=1715066792;
 h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from
 :message-id:date:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=deCFhUrwJFdWXmn9icl1qryo1c2Ck7AV4gufuoa8/6A=;
 b=Y8e6MqAnU+AxFedYMoljnZAMxhDIi296yqY06Qv/6MIBzhY7csdvvPij9yq+ljVpL1
 TjMY15er4Bq2JVnVwlL4xlvDu+YNlkjzp0WUMFRXe6Z3z7x7+f158HuCZ/f+SsNiZOxr
 RQZDZFtybRXJ02NmHSAWlstoZgRyR+u0gKRUuNViBq2wWSieLSNz6cBSy4zzL7JVsAIf
 17B1qAQXyZgt0RzoHQfNpBcVsIYhy9nDVMOvjwGAw0MkS7bsqKHW3fLwBzKB1qa0MnUr
 SEqL0oZMiSUYNDdwPYGZGMbS6Xzkj5PsWOWOrskEg1qRzx5B9UbYfdTQEt1CJGmq3kJj
 TMWw==
X-Gm-Message-State: AOJu0Yw7UdRhDqxrViK0Gmu4bEoe0X/Ua9rhbExhv2xJvnk3t6RQ8rR8
 vGi8BpKI574dVyiGmwGhfN1aXuhkwKp/0ZRm0AdiPk8q3NE5d0WX
X-Google-Smtp-Source: AGHT+IGzbhiMJ4YLXj9l7hG+oYqd5k/GltMRVuWtT2ki3xD0uDq1UT2Ezq6jrphqvKOe01RgXqc7qw==
X-Received: by 2002:a17:902:f544:b0:1e2:6198:9e53 with SMTP id
 h4-20020a170902f54400b001e261989e53mr16501550plf.0.1714461992540; 
 Tue, 30 Apr 2024 00:26:32 -0700 (PDT)
Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161])
 by smtp.gmail.com with ESMTPSA id
 km14-20020a17090327ce00b001e77d1e6b64sm21662337plb.241.2024.04.30.00.26.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 30 Apr 2024 00:26:32 -0700 (PDT)
Date: Tue, 30 Apr 2024 16:26:13 +0900
Message-ID: <eke7mspb1fca.wl-kobarity@HIDDEN>
From: kobarity <kobarity@HIDDEN>
To: Patrick Poitras <patrick.f.poitras@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#70617: 30.0.50;
 python-indent-shift-right indents left when line is whitespace
In-Reply-To: <861q6os4zy.fsf@HIDDEN>
References: <CACpx+d6b9madXDzJz5Vb6KpxTTDeUkbOmW2RdNytZYfMr1qDyA@HIDDEN>
 <861q6os4zy.fsf@HIDDEN>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue)
 FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0
 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset=US-ASCII
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70617
Cc: 70617 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii wrote:
> 
> > From: Patrick Poitras <patrick.f.poitras@HIDDEN>
> > 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?

Hi Patrick,

I believe this behavior is intended to avoid adding extra whitespaces
when processing a region containing blank lines.  There may be an
approach to change to indent even a blank line as a special case when
the region is not active, but I personally think that Enter or TAB
indentation is sufficient in such cases.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70617; Package emacs. Full text available.

Message received at 70617 <at> debbugs.gnu.org:


Received: (at 70617) by debbugs.gnu.org; 29 Apr 2024 12:55:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 08:55:48 2024
Received: from localhost ([127.0.0.1]:57132 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1QXs-0002HC-4V
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 08:55:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:46846)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s1QXq-0002H6-HR
 for 70617 <at> debbugs.gnu.org; Mon, 29 Apr 2024 08:55:46 -0400
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 <eliz@HIDDEN>)
 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==;
Date: Mon, 29 Apr 2024 15:55:13 +0300
Message-Id: <861q6os4zy.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Patrick Poitras <patrick.f.poitras@HIDDEN>,
 kobarity <kobarity@HIDDEN>
In-Reply-To: <CACpx+d6b9madXDzJz5Vb6KpxTTDeUkbOmW2RdNytZYfMr1qDyA@HIDDEN>
 (message from Patrick Poitras on Sat, 27 Apr 2024 16:16:46 -0700)
Subject: Re: bug#70617: 30.0.50;
 python-indent-shift-right indents left when line is whitespace
References: <CACpx+d6b9madXDzJz5Vb6KpxTTDeUkbOmW2RdNytZYfMr1qDyA@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70617
Cc: 70617 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Patrick Poitras <patrick.f.poitras@HIDDEN>
> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70617; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Apr 2024 23:17:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 19:17:32 2024
Received: from localhost ([127.0.0.1]:49803 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0rIS-00025Y-1J
	for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 19:17:32 -0400
Received: from lists.gnu.org ([2001:470:142::17]:54562)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <patrick.f.poitras@HIDDEN>) id 1s0rIP-00025S-Mj
 for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 19:17:30 -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 <patrick.f.poitras@HIDDEN>)
 id 1s0rI0-0007xO-Ad
 for bug-gnu-emacs@HIDDEN; Sat, 27 Apr 2024 19:17:04 -0400
Received: from mail-vk1-xa32.google.com ([2607:f8b0:4864:20::a32])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <patrick.f.poitras@HIDDEN>)
 id 1s0rHw-0005b9-W0
 for bug-gnu-emacs@HIDDEN; Sat, 27 Apr 2024 19:17:04 -0400
Received: by mail-vk1-xa32.google.com with SMTP id
 71dfb90a1353d-4dad331b828so1032956e0c.2
 for <bug-gnu-emacs@HIDDEN>; Sat, 27 Apr 2024 16:16:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714259818; x=1714864618; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=5MEsKUF5BcMeE7Ekngk0q62Tgk6UZdLJKT6ra7WenN8=;
 b=nsmtOfVzzagIIawRxRtwiytK/t8lYgEL5RXFvDy5gqnXULekl7gufBdWFLhxK+WdFZ
 AwM45eiTx1CbJyhzGF65o69fNZKn+YtQ+mU7AWcLtdDmLXvjJDgGWVXjZ3gYGFePvwW3
 PddDjTE5Gnrlfdb9tBZthPT8v/LZY5zFHM9X5cz24Iko96WQjdpotvpsyR4uWkhtj6J8
 yQc4R426QyyFB4YOv073Ew6+EMd5X5JRf97rhJGb9ZAZ8MuJ0Rw23k9ywermCbu6g3jv
 eDH411eSXBZ2EfQqSPy6711K/tMO54ywDckzsAurAyCyCketxNfTqO04GmK3tCQH+jdo
 AzXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714259818; x=1714864618;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=5MEsKUF5BcMeE7Ekngk0q62Tgk6UZdLJKT6ra7WenN8=;
 b=wVqkLyolH1UHXL7O4IWHkjL4dZUxE2J5vymnriMyGhmaTmxGmSg8032/9QA5FWeiMo
 Div5FkqRSnha++uuEL9euYC5rrQcuCl+m0I+tOKAhGESgZk5KgA8pLh1bApZMk9fmLo2
 IAwwYORAzkX3nLrvMmuZA5O9GBYEdoqZDwcziKdI8y89OCqxAUJRtNhX77SjeOw0NXUl
 hFUFXVehy/lkek9qqJElT7YLjKbKqOFG12PweFa+KWl1q7GlW3v/1o77YpCqlqw6lFJi
 zBJy2s0u7RO3I589V8SOzogw6xlFrxBYY7+SqUrexFtC3X5k1aJstmkCrpzTnlIO/LYc
 jJDA==
X-Gm-Message-State: AOJu0Yx9sKZZH5bhojw15QnunF83w8rp4mqk2biHNzvaPVazZfNihc9P
 bATNtxzUeBj24lPJDmgCsHGmf2fL4HaMpWOL1kWNoWrSAeG0Xa30dsFMlUPndHhAw+BTU2lr20V
 TD4H4dvaHRJ7rjcm4ixyBttvUWPfZ3vQf
X-Google-Smtp-Source: AGHT+IGUk8aU+lJPKfehstggi0JfclEK1GfHbC+R/PzvkKFrBeI5YeQZeAdqgWE5owJF5tyW1jlUE/AyvQjMS4xBEpM=
X-Received: by 2002:a05:6122:895:b0:4d3:499a:830c with SMTP id
 21-20020a056122089500b004d3499a830cmr7322434vkf.13.1714259817421; Sat, 27 Apr
 2024 16:16:57 -0700 (PDT)
MIME-Version: 1.0
From: Patrick Poitras <patrick.f.poitras@HIDDEN>
Date: Sat, 27 Apr 2024 16:16:46 -0700
Message-ID: <CACpx+d6b9madXDzJz5Vb6KpxTTDeUkbOmW2RdNytZYfMr1qDyA@HIDDEN>
Subject: 30.0.50;
 python-indent-shift-right indents left when line is whitespace
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="0000000000007861c406171c37a5"
Received-SPF: pass client-ip=2607:f8b0:4864:20::a32;
 envelope-from=patrick.f.poitras@HIDDEN; helo=mail-vk1-xa32.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--0000000000007861c406171c37a5
Content-Type: text/plain; charset="UTF-8"

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.

----- System information -----
In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.41, cairo version 1.18.0) of 2024-04-27 built on
 localhost.localdomain
Windowing system distributor 'The X.Org Foundation', version 11.0.12101012
System Description: openSUSE Tumbleweed

Configured using:
 'configure --with-x --with-xpm --with-jpeg --with-tiff --with-png
 --with-rsvg --with-dbus --with-xft --with-tree-sitter
 --with-x-toolkit=gtk3 --with-native-compilation=aot --with-cairo
 --with-libotf --with-modules --without-sound
 --enable-link-time-optimization --with-json
 SYS=--build=x86_64-suse-linux 'CFLAGS=-flto -O3 -march=native
 -mtune=native''

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LIBSELINUX LIBSYSTEMD MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
SECCOMP THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM
XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix

Major mode: Python

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util time-date subr-x mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-seq compile
text-property-search comp-run comp-common python rx project byte-opt gv
bytecomp byte-compile compat pcase treesit comint ansi-osc ring
cl-loaddefs cl-lib ansi-color rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo gtk
x-toolkit xinput2 x multi-tty move-toolbar make-network-process
native-compile emacs)

Memory information:
((conses 16 116911 12528) (symbols 48 7663 0) (strings 32 37654 2057)
 (string-bytes 1 1726924) (vectors 16 21902)
 (vector-slots 8 237509 8385) (floats 8 49 13) (intervals 56 419 0)
 (buffers 992 13))

--0000000000007861c406171c37a5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi all.</div><div><br></div><div>I&#39;ve noticed thi=
s weird behavior of python-indent-shift-right.</div><div><br></div><div>Let=
&#39;s say I have a block of code. The &quot;|&quot; character represents m=
y cursor</div><div><br></div><div>In a python file, I write</div><div><br><=
/div><div>if True:</div><div>|</div><div><br></div><div>(... file contents =
continue)<br></div><div><br></div><div>and then call python-indent-shift-ri=
ght on an empty line. It does nothing. If the second line has any amount of=
 spaces, the whitespace is entirely deleted. <br></div><div><br></div>Given=
 that Python&#39;s whitespace is syntactically significant, the expected be=
havior should be to add an indent to an empty line, or to prepend 4 charact=
ers (or 8, given user choice) to the empty line if it has whitespace. From =
a cursory glance, I think we&#39;re running into some behavior of indent-ri=
gidly that tries to prevent the addition of superfluous white space followi=
ng an indented block of code. I assume this would be potentially desirable =
for languages with non-significant whitespace, but in the case of the pytho=
n-specific function, the resulting behavior defies both the function name a=
nd description.<br><div><br></div><div>----- System information -----<br></=
div><div>In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version</=
div>=C2=A03.24.41, cairo version 1.18.0) of 2024-04-27 built on<br>=C2=A0lo=
calhost.localdomain<br>Windowing system distributor &#39;The X.Org Foundati=
on&#39;, version 11.0.12101012<br>System Description: openSUSE Tumbleweed<b=
r><br>Configured using:<br>=C2=A0&#39;configure --with-x --with-xpm --with-=
jpeg --with-tiff --with-png<br>=C2=A0--with-rsvg --with-dbus --with-xft --w=
ith-tree-sitter<br>=C2=A0--with-x-toolkit=3Dgtk3 --with-native-compilation=
=3Daot --with-cairo<br>=C2=A0--with-libotf --with-modules --without-sound<b=
r>=C2=A0--enable-link-time-optimization --with-json<br>=C2=A0SYS=3D--build=
=3Dx86_64-suse-linux &#39;CFLAGS=3D-flto -O3 -march=3Dnative<br>=C2=A0-mtun=
e=3Dnative&#39;&#39;<br><br>Configured features:<br>CAIRO DBUS FREETYPE GIF=
 GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG<br>LIBSELINUX LIBSYSTEMD MODULES N=
ATIVE_COMP NOTIFY INOTIFY PDUMPER PNG<br>SECCOMP THREADS TIFF TOOLKIT_SCROL=
L_BARS TREE_SITTER X11 XDBE XIM<br>XINPUT2 XPM GTK3 ZLIB<br><br>Important s=
ettings:<br>=C2=A0 value of $LANG: en_US.utf8<br>=C2=A0 value of $XMODIFIER=
S: @im=3Dlocal<br>=C2=A0 locale-coding-system: utf-8-unix<br><br>Major mode=
: Python<br><br>Minor modes in effect:<br>=C2=A0 tooltip-mode: t<br>=C2=A0 =
global-eldoc-mode: t<br>=C2=A0 eldoc-mode: t<br>=C2=A0 show-paren-mode: t<b=
r>=C2=A0 electric-indent-mode: t<br>=C2=A0 mouse-wheel-mode: t<br>=C2=A0 to=
ol-bar-mode: t<br>=C2=A0 menu-bar-mode: t<br>=C2=A0 file-name-shadow-mode: =
t<br>=C2=A0 global-font-lock-mode: t<br>=C2=A0 font-lock-mode: t<br>=C2=A0 =
blink-cursor-mode: t<br>=C2=A0 minibuffer-regexp-mode: t<br>=C2=A0 line-num=
ber-mode: t<br>=C2=A0 transient-mark-mode: t<br>=C2=A0 auto-composition-mod=
e: t<br>=C2=A0 auto-encryption-mode: t<br>=C2=A0 auto-compression-mode: t<b=
r><br>Load-path shadows:<br>None found.<br><br>Features:<br>(shadow sort ma=
il-extr emacsbug message mailcap yank-media puny dired<br>dired-loaddefs rf=
c822 mml mml-sec password-cache epa derived epg rfc6068<br>epg-config gnus-=
util time-date subr-x mm-decode mm-bodies mm-encode<br>mail-parse rfc2231 m=
ailabbrev gmm-utils mailheader sendmail rfc2047<br>rfc2045 ietf-drums mm-ut=
il mail-prsvr mail-utils cl-seq compile<br>text-property-search comp-run co=
mp-common python rx project byte-opt gv<br>bytecomp byte-compile compat pca=
se treesit comint ansi-osc ring<br>cl-loaddefs cl-lib ansi-color rmc iso-tr=
ansl tooltip cconv eldoc paren<br>electric uniquify ediff-hook vc-hooks lis=
p-float-type elisp-mode mwheel<br>term/x-win x-win term/common-win x-dnd to=
uch-screen tool-bar dnd fontset<br>image regexp-opt fringe tabulated-list r=
eplace newcomment text-mode<br>lisp-mode prog-mode register page tab-bar me=
nu-bar rfn-eshadow isearch<br>easymenu timer select scroll-bar mouse jit-lo=
ck font-lock syntax<br>font-core term/tty-colors frame minibuffer nadvice s=
eq simple cl-generic<br>indonesian philippine cham georgian utf-8-lang misc=
-lang vietnamese<br>tibetan thai tai-viet lao korean japanese eucjp-ms cp51=
932 hebrew greek<br>romanian slovak czech european ethiopic indian cyrillic=
 chinese<br>composite emoji-zwj charscript charprop case-table epa-hook<br>=
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs<br>=
theme-loaddefs faces cus-face macroexp files window text-properties<br>over=
lay sha1 md5 base64 format env code-pages mule custom widget keymap<br>hash=
table-print-readable backquote threads dbusbind inotify<br>dynamic-setting =
system-font-setting font-render-setting cairo gtk<br>x-toolkit xinput2 x mu=
lti-tty move-toolbar make-network-process<br>native-compile emacs)<br><br>M=
emory information:<br>((conses 16 116911 12528) (symbols 48 7663 0) (string=
s 32 37654 2057)<br>=C2=A0(string-bytes 1 1726924) (vectors 16 21902)<br>=
=C2=A0(vector-slots 8 237509 8385) (floats 8 49 13) (intervals 56 419 0)<br=
><div>=C2=A0(buffers 992 13))</div></div>

--0000000000007861c406171c37a5--




Acknowledgement sent to Patrick Poitras <patrick.f.poitras@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#70617; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 9 May 2024 07:45:01 UTC

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