py-newline-and-indent leaves eol whitespace cruft
Bug #1100892 reported by
Barry Warsaw
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Medium
|
Andreas Roehler |
Bug Description
py-newline-
To reproduce, turn on global-
-----snip snip-----
def foo():
x = some_long_
-----snip snip-----
Now, put point on the 'e' of expialidocious and hit RET
You will see that there's an extra space left after the "6, ". All trailing whitespace should instead be removed.
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
milestone: | none → 6.1.1 |
importance: | Undecided → Medium |
Changed in python-mode: | |
status: | New → In Progress |
Changed in python-mode: | |
status: | In Progress → Fix Committed |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
On Jan 17, 2013, at 07:36 PM, Andreas Roehler wrote:
>Am 17.01.2013 19:07, schrieb Barry Warsaw: and-indent leaves extra whitespace at eol if used inside an whitespace- smart-delete- p to `t'
>> Public bug reported:
>>
>> py-newline-
>> existing construct. It should instead clean up all trailing whitespace.
>> I believe this is a regression.
>
>Auto-delete trailing whitespace was cancelled when fixing lp:1020220
>
>Customizing then introduced py-trailing-
>should do it. Maybe change the default?
A few comments:
For py-newline- and-indent, I think it is not correct that python-mode delete
all trailing whitespace in the buffer. It should only delete the trailing
whitespace on the line you are editing (specifically: the line on which you
hit RET).
I'm also not sure that the same variable which controls trailing whitespace
cleanup for RET should also control buffer-wide whitespace cleanup on save.
As the docstring for py-t-w-s-d-p says, this can have negative consequences
for editing other people's code.
For example: I always want to clean up the line I'm editing, but I do *not*
want to clean up the entire buffer, since that will introduce lots of cruft
into diffs. If I do want to clean up the entire buffer, I have a separate
function I can call explicitly (or I could put it on a save hook myself).
As for the default, if the save hook side-effect didn't exist, then yes, it
should be t by default.