bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62696: python.el: Extra indentation for conditionals


From: kobarity
Subject: bug#62696: python.el: Extra indentation for conditionals
Date: Thu, 13 Apr 2023 00:26:28 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (Gojō) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]