Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

untabify and remove trailing whitespaces in emacs

I'm working on large scale project where in there are ~100 engineers working on many files. I would like to see if I could add customization in emacs to remove trailing white spaces and untabify the lines which i'm editing. It wont be good idea to untabify and remove whitespaces in large files which are not related my changes. (I agree, everyone in the team should be following some basic rules. What to do, sometime it doesn't work in that way. :( ).

Currently I've enabled:

(show-ws-toggle-show-trailing-whitespace)
(show-ws-toggle-show-tabs)

Issue with these options, it makes all over files either yellow or white if owner of the file hasn't fixed his tabs and trailing whitespaces.

It would be great if you could point me to emacs options which will enable me "remove whitespaces and tabs on lines which I'm editing" (not all over the files).

like image 757
Xprog Avatar asked Sep 14 '10 00:09

Xprog


1 Answers

This is not an answer to your question. But I suspect you will be interested to know about it:

http://github.com/glasserc/ethan-wspace

It keeps track of whether a file is "clean" (free of trailing whitespace and tabs) when you open it, and will automatically remove them when you save it if and only if it was clean when you started. This means it will keep a file clean if it started clean, and will leave alone any files that were dirty (i.e. someone else didn't follow the rules).

like image 69
pheaver Avatar answered Sep 23 '22 08:09

pheaver