all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Patrick Poitras <patrick.f.poitras@gmail.com>,
	kobarity <kobarity@gmail.com>
Cc: 70617@debbugs.gnu.org
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	[thread overview]
Message-ID: <861q6os4zy.fsf@gnu.org> (raw)
In-Reply-To: <CACpx+d6b9madXDzJz5Vb6KpxTTDeUkbOmW2RdNytZYfMr1qDyA@mail.gmail.com> (message from Patrick Poitras on Sat, 27 Apr 2024 16:16:46 -0700)

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





  reply	other threads:[~2024-04-29 12:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27 23:16 bug#70617: 30.0.50; python-indent-shift-right indents left when line is whitespace Patrick Poitras
2024-04-29 12:55 ` Eli Zaretskii [this message]
2024-04-30  7:26   ` kobarity
2024-05-09  7:39     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861q6os4zy.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70617@debbugs.gnu.org \
    --cc=kobarity@gmail.com \
    --cc=patrick.f.poitras@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.