Emacs indents my code like this:
def my_function(
a, b, c):
pass
if my_function(
1, 2, 3):
pass
However, PEP8 states that it should be indented like this, to avoid confusing the hanging indent with the next line:
def my_function(
a, b, c):
pass
if my_function(
1, 2, 3):
pass
How can I configure emacs' old python.el
to use the existing python-continuation-offset
variable in this case (after an opening parenthesis and newline), so as to indent the second way?
What is a Hanging Indent? A hanging indent is a type of indentation where the first line of a paragraph is not indented, but subsequent lines in the same paragraph are indented. In Google Docs, you can create a hanging indent by following these simple steps: Step 1: Select the text you want to format.
According to the PEP 8 standard, there are two ways to line up the closing braces, brackets, or parentheses. First, line it up with the first non-whitespace character of the previous line. Second, line it up with the first character that starts the multi-line construct. What is this?
Just for information, Python mode in GNU Emacs 25 formats this correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With