This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: New serial features (and an identation question)...



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]