On Thu, Dec 18, 2014 at 3:07 PM, Dmitry Gutov wrote: > > Personally, I like this lighter-weight approach: > > https://github.com/purcell/whitespace-cleanup-mode In my case I have show-trailing-whitespace set and my trailing-whitespace face is "red3". That made it very painful to insert blank lines in the presence of cc-mode's new electric indentation, even when some other mechanism / package / mode ultimately was going to clean things up (assuming I saved the file). Until I did a save my new electric whitespace messes were "in my face". Steve Purcell's approach works only if one's file is pristine. Prior to the introduction of electric indentation I had no need of such a package: I was careful not to introduce inappropriate whitespace. But since I regularly have to work on files where other people have been less fastidious Steve's package would not clean these electric whitespace messes. I actually really like the behavior of the code I posted. It has an added small bonus. Normally it does not cleanup pre-existing whitespace. When I modify a line with trailing whitespace it does cleanup that one line, something my projects' guidelines allow. /john