X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=Documentation%2FCodingStyle;h=72968cd5eaf3286f08cc6eb7dfb3115ff9c5ce90;hb=c20351846efcb755ba849d9fb701fbd9a1ffb7c2;hp=1875e502f87205a1dcaf268d0af78127ee336144;hpb=cb28a1bbdb4790378e7366d6c9ee1d2340b84f92;p=linux-2.6-omap-h63xx.git diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 1875e502f87..72968cd5eaf 100644 --- a/Documentation/CodingStyle +++ b/Documentation/CodingStyle @@ -483,17 +483,25 @@ values. To do the latter, you can stick the following in your .emacs file: (* (max steps 1) c-basic-offset))) +(add-hook 'c-mode-common-hook + (lambda () + ;; Add kernel style + (c-add-style + "linux-tabs-only" + '("linux" (c-offsets-alist + (arglist-cont-nonempty + c-lineup-gcc-asm-reg + c-lineup-arglist-tabs-only)))))) + (add-hook 'c-mode-hook (lambda () (let ((filename (buffer-file-name))) ;; Enable kernel mode for the appropriate files (when (and filename - (string-match "~/src/linux-trees" filename)) + (string-match (expand-file-name "~/src/linux-trees") + filename)) (setq indent-tabs-mode t) - (c-set-style "linux") - (c-set-offset 'arglist-cont-nonempty - '(c-lineup-gcc-asm-reg - c-lineup-arglist-tabs-only)))))) + (c-set-style "linux-tabs-only"))))) This will make emacs go better with the kernel coding style for C files below ~/src/linux-trees.