This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
RE: New serial features (and an identation question)...
- To: Grant Edwards <grante at visi dot com>
- Subject: RE: [ECOS] New serial features (and an identation question)...
- From: Gary Thomas <gthomas at redhat dot com>
- Date: Wed, 08 Mar 2000 09:03:54 -0700 (MST)
- Cc: ecos-discuss at sourceware dot cygnus dot com
On 08-Mar-00 Grant Edwards wrote:
> Due to brain damage caused by my learning Pascal at an early
> age, I just can't grok code with old-style K&R indentation. So,
> I've re-indented the sections that I've worked on, in what is
> more-or-less the gnu style.
>
> Q: Is there a config file for gnu indent that I can use to
> re-format them back to the eCos standard format before I
> generate patches? Otherwise I can do it by hand, but I'd
> rather take the lazy route...
>
I use c++-mode in emacs with these settings:
;;=================================================================
;; eCos C/C++ mode Setup.
;;
;; bsd mode: indent = 4, &c &c
;; tail comments are at col 40.
;; uses tabs not spaces in C
(setq c-basic-offset 4)
(setq c-mode-hook
(function
(lambda ()
(c-set-style "bsd")
(setq comment-column 40)
(setq indent-tabs-mode nil)
)))
(setq c++-mode-hook c-mode-hook)
; Make all C and C++ use the c++ major editing mode...
(setq auto-mode-alist
(append '(("\\.C$" . c++-mode)
("\\.cc$" . c++-mode)
("\\.cpp$" . c++-mode)
("\\.cxx$" . c++-mode)
("\\.hxx$" . c++-mode)
("\\.inl$" . c++-mode)
("\\.c$" . c++-mode) ; to edit C code
("\\.h$" . c++-mode) ; to edit C code
) auto-mode-alist))
;;=================================================================
;; eCos ASM mode Setup.
;;
;; bsd mode: indent = 4, &c &c
;; tail comments are at col 40.
;; uses tabs not spaces in C
(setq asm-mode-hook
(function
(lambda ()
(setq comment-column 40)
(setq indent-tabs-mode nil)
))
)