The key is M-x untabify.  You can invoke this automatically with
something like te following untested form in your ~/.emacs

(add-hook java-mode
          (function (lambda ()
                      (add-hook 'local-write-file-hooks
                                (function (lambda ()
                                  (save-excursion
                                    (widen)
                                    (untabify (point-min) (point-max)))))))))

This is a good way to install other mode-specific source normalization
hooks.  For instance, I always delete trailing whitespace in my source
buffers.  This greatly reduces the noise merge diff output during
cooperative development.

Remember, this will munge your code in ways you dno't expect if you
have literal tab chars inside literal strings.

Reply via email to