As an emacs user (read: junkie) I always disable the "Indent Tabs Mode", to prevent indentation from inserting tabs into the code:
M-x customize-apropos <ENTER> indent-tabs-mode <ENTER>(on normal PC keyboards, the M-x stands for the key combination <ALT> x)
- toggle the value of this customization variable from "on" to "nil"
- press "Save for Future Sessions"
If you can't stand the fact that the code you're working with has tabs in it, and you don't mind causing all sorts of merge problems for your fellow developers, you can use the expand utility to expand the tabs, and replace them with spaces:
expand filename.ext > filename.ext.expanded
mv -f filename.ext.expanded filename.ext
(use the -t command line option if the default translation of one tab to eight spaces is not appropriate for the file in question).