On Wed, 26 Sep 2007 15:49:25 +0100, "Catalin Marinas" catalin.marinas@gmail.com wrote:
Hi,
The feature to strip the trailing spaces in a document at save time is indeed useful but this also affects the lines I didn't write in a file. Since I work a lot with patches, modifying one line in a file may lead to a longer patch because of the white space removal. This makes reviewing the patches on public mailing lists more difficult (and the Linux people might reject the patch, unless one does two separate patches, one for trailing spaces stripping and the other being the real modification).
OTOH, trailing spaces are not accepted on the projects I work, though some files still have them.
My solution (this is actually the behaviour of emacs) is to strip the trailing spaces of a single line when newline is inserted.
Nice idea. I know the described problem when creating patches on sources where trailing spaces exist. In general, I delete all parts of the patch which are created because of trailing spaces.
Anyway, I would like to add an option. So, the user can decide whether to always get trailing spaces cut off at saving time or on newline. The problem is, sometimes you edit files but don't insert a newline, so the trailing spaces still exist. If you think of this and add and remove the newline to manually invoke the function, all is fine. But I guess there are some people like me, who probably won't think of it ;-).
Regards, Enrico