public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] New serial features (and an identation question)...
       [not found] <20000308095223.A32604@visi.com>
@ 2000-03-08  8:04 ` Gary Thomas
  0 siblings, 0 replies; only message in thread
From: Gary Thomas @ 2000-03-08  8:04 UTC (permalink / raw)
  To: Grant Edwards; +Cc: ecos-discuss

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-03-08  8:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20000308095223.A32604@visi.com>
2000-03-08  8:04 ` [ECOS] New serial features (and an identation question) Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).