fill-paragraph (M-q) does awful things to python code

Bug #328808 reported by Mkc-users
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-mode.el
New
Wishlist
Andreas Roehler

Bug Description

It would be nice if fill-paragraph (M-q) did reasonable
things to python code. For example, it could wrap all
strings and comments in the enclosing function,
breaking up strings into adjacent one-line substrings
"like" "this".

Even better, it would be nice if it would reformat long
expressions so that they were nicely wrapped (e.g.,
arranging split binary expressions so that the operator
is at the beginning of a line rather than the end).

[http://sourceforge.net/tracker/index.php?func=detail&aid=1241188&group_id=86916&atid=581349]

Revision history for this message
Hoffmanm-users (hoffmanm-users) wrote :

NOTABUG. This is really more of a feature request than a bug.

Bryce Harrington (bryce)
Changed in python-mode:
importance: Medium → Wishlist
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Hi,

thanks for the report.
However, IMHO that's not specific enough in order to change the code.

Please provide editing examples, so we may see, what python-mode should do in the circumstances.

Andreas

Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
Changed in python-mode:
status: New → Opinion
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Reopened WRT recent changes of pep8 :)

https://mail.python.org/pipermail/python-list/2016-April/707473.html

multi-line expressions should break *after* infix operators

Changed in python-mode:
status: Opinion → New
Changed in python-mode:
milestone: none → 6.2.3
Changed in python-mode:
milestone: 6.2.3 → 6.2.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.