all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kobarity <kobarity@gmail.com>
To: Gustaf Waldemarson <gustaf.waldemarson@gmail.com>
Cc: 62696@debbugs.gnu.org
Subject: bug#62696: python.el: Extra indentation for conditionals
Date: Thu, 13 Apr 2023 00:26:28 +0900	[thread overview]
Message-ID: <eke7h6tljf4r.wl-kobarity@gmail.com> (raw)
In-Reply-To: <CABehr5ffFuykHkieRRX+zTSZF0t_qv3fd86USZZfET+Qc+se1g@mail.gmail.com>


Gustaf Waldemarson wrote:
> "Increase indentation inside parens of a block.
> When this variable is set to non-nil and the contents of a block
> inside parens are indented to the same level as outside the same
> block, increase the indentation of the line."

Hi Gustaf,

Thank you for your suggestion.  I think this is more readable and
would like to make changes in this direction.

Just to be clear, what I wanted to express by "some items follow the
opening paren on the same line in a block statement" is that it only
works with the code like the following:

#+begin_src python
if ("VALUE" in my_unnecessarily_long_dictionary
        and some_other_long_condition_case):
    do_something()
#+end_src

And it does not work for the code like the following:

#+begin_src python
if (
    "VALUE" in my_unnecessarily_long_dictionary
    and some_other_long_condition_case):
    do_something()
#+end_src

This is intentional.  Because this code is usually written as follows:

#+begin_src python
if (
    "VALUE" in my_unnecessarily_long_dictionary
    and some_other_long_condition_case
):
    do_something()
#+end_src

In this case, there is no need for extra indentation.  As I wrote in
the previous mail, this case is processed by the existing code and can
be customized with `python-indent-def-block-scale'.

However, this may be a marginal difference.  In any case, I will wait
a few more days for other comments and hope to revise the patch over
the weekend.

Best regards,
kobarity





  reply	other threads:[~2023-04-12 15:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06 12:47 bug#62696: python.el: Extra indentation for conditionals Gustaf Waldemarson
2023-04-09 12:11 ` kobarity
2023-04-10 11:11   ` Gustaf Waldemarson
2023-04-10 15:21     ` kobarity
2023-04-11 11:11       ` Gustaf Waldemarson
2023-04-12 15:26         ` kobarity [this message]
2023-04-16 13:24           ` kobarity
2023-04-16 15:49             ` Gustaf Waldemarson
2023-04-18 14:23               ` kobarity
2023-04-20  8:22                 ` Eli Zaretskii
2023-04-20 13:40                   ` Gustaf Waldemarson
2023-04-20 14:19                     ` kobarity
2023-04-20 17:44                       ` Gustaf Waldemarson
2023-04-22  9:33                       ` 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=eke7h6tljf4r.wl-kobarity@gmail.com \
    --to=kobarity@gmail.com \
    --cc=62696@debbugs.gnu.org \
    --cc=gustaf.waldemarson@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.