lkml.org 
[lkml]   [1996]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: <sigh> Coding Style doc: Let me try again
On Wed, 24 Jul 1996, Arthur D. Jerijian wrote:

> Since I'm not an ELISP expert, a well-knowing hacker might want
> to fix this particular problem in the CodingStyle doc.
>

all comments aside, here is a patch for Documentation/CodingStyle:

--- linux/Documentation/CodingStyle~ Thu Jul 25 21:51:29 1996
+++ linux/Documentation/CodingStyle Thu Jul 25 22:00:21 1996
@@ -179,29 +179,16 @@
So, you can either get rid of GNU emacs, or change it to use saner
values. To do the latter, you can stick the following in your .emacs file:

-(defun linux-c-mode ()
- "C mode with adjusted defaults for use with the Linux kernel."
- (interactive)
- (c-mode)
- (setq c-indent-level 8)
- (setq c-brace-imaginary-offset 0)
- (setq c-brace-offset -8)
- (setq c-argdecl-indent 8)
- (setq c-label-offset -8)
- (setq c-continued-statement-offset 8)
- (setq indent-tabs-mode nil)
- (setq tab-width 8))
+; use 8 space offsets for C mode
+;
+(add-hook 'c-mode-common-hook
+ (function(lambda()
+ (setq c-basic-offset 8)
+ (setq c-indent-level 8)
+ (setq c-continued-statement-offset 8)
+ (setq c-label-offset -8))))

-This will define the M-x linux-c-mode command. When hacking on a
-module, if you put the string -*- linux-c -*- somewhere on the first
-two lines, this mode will be automatically invoked. Also, you may want
-to add
-
-(setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode)
- auto-mode-alist))
-
-to your .emacs file if you want to have linux-c-mode switched on
-automagically when you edit source files under /usr/src/linux.
+This will cause emacs to indent at 8 spaces.

But even if you fail in getting emacs to do sane formatting, not
everything is lost: use "indent".
--
Why Linux? source code. POSIX. tcpip. job control. support from the authors.
drivers for most hardware. because one terminal or process is never enough.
forget the other O/Ss, i use Linux- the choice of a gnu generation.




\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.369 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site