Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jun 2005 19:55:54 -0400
From:      Charles Swiger <cswiger@mac.com>
To:        "Li, Qing" <qing.li@bluecoat.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: issue with route
Message-ID:  <F2080489-AB0C-47F2-9DB5-21718D4172AF@mac.com>
In-Reply-To: <48D44BB27BDE3840BDF18E59CB169A5C012A51E0@bcs-mail3.internal.cacheflow.com>
References:  <48D44BB27BDE3840BDF18E59CB169A5C012A51E0@bcs-mail3.internal.cacheflow.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Jun 3, 2005, at 6:40 PM, Li, Qing wrote:
>> Are you perhaps asking for .emacs setting which conforms to this (the
>> four-space) style?
>
>     Yes, do you have one ?

For most purposes, if you set c-basic-offset to 4, this will also  
work fine with classic BSD-style code using 8-chars as the initial  
offset, since c-mode will go from that indent if the code you are  
modifying is using it.  You still want tab-width set to 8, so  
consider placing something like this in your .emacs:

;; Define C indenting style
(defconst my-c-style
     '((c-basic-offset                . 4)
       (c-tab-always-indent           . t)
       ; [ ...snip... ]
       (c-echo-syntactic-information-p . f)  ; change to "t" if you  
want to see indent info
       )
     "Qing's C programmming style :-)")

;; Customizations for both c-mode and c++-mode
(defun my-c-mode-common-hook ()
     (c-set-style "bsd")
     (c-add-style "PERSONAL" my-c-style t)
     (setq tab-width 8
           indent-tabs-mode nil)
     )

(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)

...and see whether that comes closer to what you want.  Hmm, this may  
not add additional indentation for the "two + lines + gets..." case.   
So also try putting this:

       (c-offsets-alist               . ((arglist-close     . c- 
lineup-arglist)
                                         (statement-cont    . ++)))

...into the my-c-style block as well, this seems to work.

-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F2080489-AB0C-47F2-9DB5-21718D4172AF>