purcell/whitespace-cleanup-mode — pull request #5 by robru (2014-12-29 01:27:29+00:00)
Title: Do not strip whitespace when it precedes point.

I have emacs configured to auto-save on a 1s idle timer. This turns out to be infuriating when combined with automatic whitespace stripping, because basically every time I hit enter to start a new line, the auto-indent gets immediately stripped away. In my personal emacs config I'm doing this now:

```
(defadvice whitespace-cleanup-mode-write-file (around preserve-point activate)
"Stop whitespace stripping when point is looking at spaces."
(when (not (looking-back "\\s-$")) ad-do-it))
```

But I thought maybe other people would enjoy this too ;-) So I added a simple check that prevents whitespace stripping in the event that point is at the end of a line that ends with spaces. Let me know what you think, thanks.