I stopped using emacs for my Java/Groovy code ever since IntellijIDEA came
around, so can't give you an expert advice. IDEA has an option to remove the
trailing spaces only for modified lines. This way you will avoid messing up
anything you haven't touched.

You also can do 
    git diff --check
to see if any whitespace changes were introduced.

Cos

On Sat, Sep 12, 2015 at 04:50PM, RJ Nowling wrote:
> Additional followup:
> 
> 1) Automatically removing trailing white space caused problems with editing
> build.gradle because of the ASCII art :)
> 
> 2) To prevent emacs from mixing tabs and spaces, the following can be added
> to .emacs:
> 
> (setq-default indent-tabs-mode nil)
> 
> More tips appreciated, though!
> 
> On Sat, Sep 12, 2015 at 4:42 PM, RJ Nowling <[email protected]> wrote:
> 
> > Hi all,
> >
> > I keep introducing trailing whitespace into patches without meaning to,
> > and I'd like to know what other people do to prevent this.
> >
> > In my emacs file, I put
> >
> > (add-hook 'before-save-hook 'delete-trailing-whitespace)
> >
> > and I enabled a similar option in Eclipse.
> >
> > What do others do?
> >
> > Thanks,
> > RJ
> >

Reply via email to