[ECOS] New serial features (and an identation question)...
Gary Thomas
gthomas@redhat.com
Wed Mar 8 08:04:00 GMT 2000
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)
))
)
More information about the Ecos-discuss
mailing list