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

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

bug#34268: 27.0.50; wrong indentation in python mode


From: Andreas Röhler
Subject: bug#34268: 27.0.50; wrong indentation in python mode
Date: Thu, 23 Sep 2021 14:37:04 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:78.0) Gecko/20100101 Thunderbird/78.14.0


On 22.09.21 23:57, Lars Ingebrigtsen wrote:
Valentin Ignatev <valentignatev@gmail.com> writes:

Hey Sam, I've looked in the python.el code and it seems that it reuses
python-indent-def-block-scale for calculating an indentation.

The default value is 2 which is why inside-parens indent doubles. Setting its
value to 1 fixes the issue.

I also wonder why authors choose double indent for aligning function
arguments. Is this some kind of an oldschool code style? :)
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

If I understand correctly (and I may well not -- I don't write much
python), this is just a preference issue, and setting
`python-indent-def-block-scale' to 1 fixes the issue?

If that's what's recommended by the standards, should we flip the
default to 1?

I've added Augusto to the CCs; perhaps he has an opinion here.


py-compute-indentation from  python-mode.el here jumps to the beginning of the list and calculates the indent by adding the default-indent of this line.






reply via email to

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