ext_8103: (Default)

[identity profile] ewx.livejournal.com 2009-05-11 08:05 pm (UTC)(link)
You can customize indent-tabs-mode to nil to avoid it inserting actual tab characters. But you won't thank me for this if ever you edit the few file formats that require tabs (and that Emacs doesn't have any kind of exception for which I think includes makefiles); in that case your best bet is probably to set it locally from mode hooks.
lnr: Halloween 2023 (Default)

[personal profile] lnr 2009-05-12 11:28 am (UTC)(link)
I've not found I had to do anything to make it correctly indent code when I've been writing Perl, perhaps that's the default for perl-mode? I only find it gets it wrong if I have a regexp containing some sort of unmatched quote or opening bracket, in which case I end up having to append a comment closing it again or it refuses to line up properly :)
ext_8103: (Default)

[identity profile] ewx.livejournal.com 2009-05-12 11:36 am (UTC)(link)
Oh, it should certainly correctly indent by default. indent-tabs-mode determines whether it will insert only spaces or whether it will use tab characters (i.e. ASCII 0x09) to replace runs of spaces - which makes the file smaller but also makes the layout ambiguous (and I find can make navigation trickier as the cursor likes to go to one end of the tab or the other rather than in the middle).