unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: kobarity <kobarity@gmail.com>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Konstantin Kharlamov <hi-angel@yandex.ru>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	63959@debbugs.gnu.org
Subject: bug#63959: python-mode does not keep indentation in square brackets []
Date: Sat, 01 Jul 2023 22:42:55 +0900	[thread overview]
Message-ID: <eke7lefz6940.wl-kobarity@gmail.com> (raw)
In-Reply-To: <ff95358c-0032-2d23-e76b-9f6fd79bc20f@easy-emacs.de>


Andreas Röhler wrote:
> Thanks for your explanation, which makes me better understand your
> endeavour. A question remains: is this new feature worth that possibly
> raise of complexity? Your patch provides a higher degree of freedom
> while keeping regularity  - which is a pro.

I think it is natural for many people to indent the same as the
previous line.  In fact, it is standard behavior outside the parens.
For example, if you intentionally change the indentation of the first
line of a block, the following lines will have the same indentation:

def func():
        a = 1  # Intentionally changed.
        b = 2  # Same indent as previous line

You can even do the following, although it will result in an
IndentationError when executed:

def func():
    a = 1
        b = 2  # Intentionally changed.
        c = 3  # Same indent as previous line

If inside the parens, the following will not result in an
IndentationError:

a = (
    1,
        2,  # Intentionally changed.
        3)  # Same indent as previous line

So I rather think the rule of indenting the same as the previous line
is more useful inside parens.

I would consider making the indentation the same as the previous line
inside the parens a fix rather than a new feature.  This is why I
named the commit "Fix Python indentation of continuation lines within
parens."





  reply	other threads:[~2023-07-01 13:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  9:39 bug#63959: python-mode does not keep indentation in square brackets [] Konstantin Kharlamov
2023-06-09 11:21 ` Eli Zaretskii
2023-06-09 14:35   ` kobarity
2023-06-18 14:56     ` kobarity
2023-06-18 15:20       ` Konstantin Kharlamov
2023-06-19  8:46         ` Andreas Röhler
2023-06-24 12:37           ` kobarity
2023-06-28  6:58             ` Andreas Röhler
2023-07-01 13:42               ` kobarity [this message]
2023-07-01 13:57                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-24 12:14         ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=eke7lefz6940.wl-kobarity@gmail.com \
    --to=kobarity@gmail.com \
    --cc=63959@debbugs.gnu.org \
    --cc=andreas.roehler@easy-emacs.de \
    --cc=eliz@gnu.org \
    --cc=hi-angel@yandex.ru \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).