Re: On Tabs and Spaces
- From
- Lars Hjemli <lh@elementstorage.no>
- Date
- Oct 16, 2007, 09:04 UTC
- Message-ID
- <8c5c35580710160204s5a4f9fb3j68c0a86c4d080cb7@mail.gmail.com>
- In-Reply-To
- <471476B7.5050105@users.sourceforge.net>
On 10/16/07, Adam Piatyszek <ediap@users.sourceforge.net> wrote:
> I am kindly asking for some tips on configuring > Emacs and Vim to follow the rules used for Git and kernel code > indentation/alignment.
>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))-- larsh