Re: <sigh> Coding Style doc: Let me try again

Jeffery S. Coy Jr. (
Thu, 25 Jul 1996 21:57:18 -0700 (MST)

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.