From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#70617: 30.0.50; python-indent-shift-right indents left when line is whitespace Date: Tue, 30 Apr 2024 16:26:13 +0900 Message-ID: References: <861q6os4zy.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10445"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: 70617@debbugs.gnu.org To: Patrick Poitras , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 30 09:28:05 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 1s1huH-0002a6-6g for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Apr 2024 09:28:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1htu-0007dY-Mp; Tue, 30 Apr 2024 03:27:42 -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 1s1htt-0007dP-LX for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 03:27:41 -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 1s1htt-0002J3-CJ for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 03:27:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s1huD-0002Ba-PK for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2024 03:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Apr 2024 07:28:01 +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.17144620228392 (code B ref 70617); Tue, 30 Apr 2024 07:28:01 +0000 Original-Received: (at 70617) by debbugs.gnu.org; 30 Apr 2024 07:27:02 +0000 Original-Received: from localhost ([127.0.0.1]:59147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1htG-0002BI-G0 for submit@debbugs.gnu.org; Tue, 30 Apr 2024 03:27:02 -0400 Original-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 ) id 1s1htD-0002Ar-1H for 70617@debbugs.gnu.org; Tue, 30 Apr 2024 03:27:01 -0400 Original-Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1ec5387aed9so1052805ad.3 for <70617@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) Original-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) In-Reply-To: <861q6os4zy.fsf@gnu.org> 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:284187 Archived-At: Eli Zaretskii wrote: > > > 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? 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.