Jeff Abrahamson on Sat, 8 Dec 2001 22:30:14 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] linux indent and emacs


On Sat, Dec 08, 2001 at 06:07:11PM +0100, Jeff Abrahamson wrote:
> The linux kernel programming guidelines suggest eight space tabs,
> which I'd like to do, if only I can get emacs (20.7 here) to grok the
> idea.
> 
> They suggest the following code snippet, which doesn't do it for
> me. Any suggestions? (The emacs help doesn't seem to recognize
> c-indent-level.)
> 
> 
> (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))

I answer my own question:

<http://simplicity.net/ia/software/linux/mail/linux-kernel/msg00505.html>

(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))))

My guess is that the first one was xemacs. Why, oh why, didn't the
xemacs folks make their lisps compatible?

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>

 Buy my boyfriend's new novel: The Big Book of Misunderstanding
 <http://www.misunderstanding.net/buystuff.html>


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug