Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130463
b: refs/heads/master
c: 0acbc6c
h: refs/heads/master
i:
  130461: 7a1fa92
  130459: 6906105
  130455: 180118c
  130447: fc70cd8
  130431: bc30172
v: v3
  • Loading branch information
Teemu Likonen authored and Linus Torvalds committed Jan 30, 2009
1 parent bfe2451 commit bcd2f0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5872fb94f85d2e4fdef94657bd14e1a492df9825
refs/heads/master: 0acbc6c651911dc9ffb4f59b34306bc1ccb751e5
15 changes: 11 additions & 4 deletions trunk/Documentation/CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -483,17 +483,24 @@ 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))
(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.
Expand Down

0 comments on commit bcd2f0e

Please sign in to comment.