aboutsummaryrefslogtreecommitdiff
path: root/Documentation/CodingStyle
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-02-02 23:55:27 -0800
committerDavid S. Miller <davem@davemloft.net>2009-02-02 23:55:27 -0800
commitfb53fde9762432d091dac209bdf4f3f850117c55 (patch)
tree607b09022b206a539cb4a924e4ef476443798252 /Documentation/CodingStyle
parenteb4400e3a040b90a3ad805b01fcbc99a5f615c8f (diff)
parentb1792e367053968f2ddb48bc911d314143ce6242 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'Documentation/CodingStyle')
-rw-r--r--Documentation/CodingStyle18
1 files changed, 13 insertions, 5 deletions
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.