From: Adam Piatyszek Date: Tue, 16 Oct 2007 10:16:18 GMT Subject: Re: On Tabs and Spaces Message-ID: <47148F72.1090602@users.sourceforge.net> In-Reply-To: <8c5c35580710160204s5a4f9fb3j68c0a86c4d080cb7@mail.gmail.com> * Lars Hjemli [16 X 2007 11:04]: >>From http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/CodingStyle;h=7f1730f1a1ae2e9a6f368bdb10ff65f4568863d5;hb=HEAD > > (defun linux-c-mode () > "C mode with adjusted defaults for use with the Linux kernel." > (interactive) > (c-mode) > (c-set-style "K&R") > (setq tab-width 8) > (setq indent-tabs-mode t) > (setq c-basic-offset 8)) > > > And to use this only in a specific directory: > > (setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode) > auto-mode-alist)) Thanks! But it seems that the above settings are still imperfect, since they mixes tabs and spaces when aligning. For instance: int some_function(int some_variable) { int result; result = execute_another_function(some_variable, ..other_variable); return result; } - represents tab here, `.' - space And if one change the tab size, it will result in a messy alignment in line 5. I guess there is no ideal solution for this in Emacs. BR, /Adam -- .:. Adam Piatyszek - "ediap" .:. JID: ediap(at)jabber.org .:. .:. ediap(at)users.sourceforge.net .:. PGP key ID: 0x1F115CCB .:.