X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=Documentation%2FCodingStyle;h=72968cd5eaf3286f08cc6eb7dfb3115ff9c5ce90;hb=686665619e4424b4f80c3a49e3e1229f27ea565c;hp=1875e502f87205a1dcaf268d0af78127ee336144;hpb=a7f371e54fac49ff62bb640d4a7276fca01527e8;p=safe%2Fjmp%2Flinux-2.6 diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle index 1875e50..72968cd 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.