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

Gerd Knorr (kraxel@cs.tu-berlin.de)
Sat, 3 Aug 1996 08:49:00 +0200 (MET DST)


On Wed, 24 Jul 1996, Arthur D. Jerijian wrote:

> Hi,
>
> Apparently, my last message didn't make it to the linux-kernel
> list. <sigh> I've noticed in the Documentation/CodingStyle document
> that the LISP stuff required to getting Emacs to auto-indent C code
> is no longer correct as of Emacs 19.31. Apparently, the cc-mode.el
> stuff has been enhanced in the newer Emacs versions, causing
> incompatibilities with old cc-mode configuration settings. In fact,
> I even saw a little bit of documentation for cc-mode in the latest
> version of Emacs for Windows NT.
> Since I'm not an ELISP expert, a well-knowing hacker might want
> to fix this particular problem in the CodingStyle doc.

This one I use:

;----------------------------------------------------------------
; kernel hacking

(defun linux-kernel-compile ()
(interactive "")
(save-some-buffers 0)
(compile "cd /usr/src/linux; make zImage modules")
(other-window 1)
(goto-char (point-max))
(other-window 1))

(defun linux-c-mode ()
"C mode with adjusted defaults for use with the Linux kernel."
(interactive)
(c-mode)
(setq c-basic-offset 8)
(define-key c-mode-map "\C-c\C-c" 'linux-kernel-compile))

(setq auto-mode-alist (cons '("/usr/src/kernel/.*\\.[ch]$" . linux-c-mode)
auto-mode-alist))