inbound indentation of multiline assignements
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Undecided
|
Andreas Roehler |
Bug Description
Thanks for making such a great tool for editing python code in emacs.
If I use parentheses for multiline continuations, indentation works as I expect. For example,
foo_long_
bar_
is beautiful and just the way I like it.
On the other hand, if I use a backslash for continuations, a single indentation is created and all subsequent lines stop using the extra indentation logic. Below the third and fourth lines fail to have any extra indentation
foo_long_
bar_
(x_
(y_
It would be nice if backslash line continuations worked the same way as parethesized expressions: additional lines would continue to have all the indentation logic active.
Although I'm personally happy to use parens for continuations, others I work with strongly prefer backslash continuations and when I edit their files, it hard to not mess up their indentation.
Related branches
- python-mode.el developers: Pending requested
-
Diff: 5004 lines (+2516/-1849)5 files modifiedUnicodeEncodeError-lp:550661-test.py (+4/-0)
py-bug-numbered-tests.el (+738/-245)
python-mode-test.el (+202/-0)
python-mode-tests.sh (+88/-0)
python-mode.el (+1484/-1604)
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
Changed in python-mode: | |
status: | New → Opinion |
Changed in python-mode: | |
status: | Opinion → In Progress |
summary: |
- indentation with backslash line continuations + inbound indentation of multiline assignements |
Changed in python-mode: | |
status: | In Progress → Fix Committed |
Changed in python-mode: | |
milestone: | none → 6.0 |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
Hi,
thanks taking part.
As the indentation cases provided don't concern syntax,
I'm afraid it's a pure style question with several
solutions possible.
Interesting matter, please permit some considerations
(just personal views, which might be wrong...)
If a indent in python has not syntactic meaning, that
should be visible IMHO, if possible.
Given that's a valid argument, both styles offered are
not satisfying. I'd choose
foo_long_ long_long_ long = (
bar_ long_long_ long_long[
( x_long_ long_long_ long == X) &
( y_long_ long_long_ long == Y)])
resp.
foo_long_ long_long_ long = \
bar_ long_long_ long_long[
(x_ long_long_ long_long == X) &
(y_ long_long_ long_long == Y)]
BTW not displayed correctly here.
Indent should be at the column of first lines end.
Andreas
-- /code.launchpad .net/~a- roehler/ python- mode /code.launchpad .net/s- x-emacs- werkstatt/
https:/
https:/