lewang / ws-butler

Unobtrusively trim extraneous white-space *ONLY* in lines edited.
242 stars 26 forks source link

make optional the keeping of whitespace before point on save #9

Closed wildlava closed 10 years ago

wildlava commented 10 years ago

This adds a new variable that enables/disables the current feature that keeps whitespace before point on save, but the default is "t" (true), so default behavior remains the same as before. A user can set it to "nil" to disable the feature.

lewang commented 10 years ago

I added the your customization as a defcustom. The fix for space preservation turned out to be a little more involved.

wildlava commented 10 years ago

One comment: in my patch, I put the (set-buffer-modified-p nil) inside the conditional, since there is no need to alter this flag if the whitespace is not saved in the buffer. The end effect is the same, but I like the idea of the flag not being tweaked if not necessary.