From owner-freebsd-net@FreeBSD.ORG Fri Jun 3 23:56:10 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C84916A41F for ; Fri, 3 Jun 2005 23:56:10 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.47]) by mx1.FreeBSD.org (Postfix) with ESMTP id F23C743D48 for ; Fri, 3 Jun 2005 23:56:09 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from mac.com (smtpin01-en2 [10.13.10.146]) by smtpout.mac.com (Xserve/8.12.11/smtpout09/MantshX 4.0) with ESMTP id j53Nu1Q8008872; Fri, 3 Jun 2005 16:56:02 -0700 (PDT) Received: from [10.1.1.153] (nfw2.codefab.com [199.103.21.225] (may be forged)) (authenticated bits=0) by mac.com (Xserve/smtpin01/MantshX 4.0) with ESMTP id j53NtsiM002883; Fri, 3 Jun 2005 16:55:56 -0700 (PDT) In-Reply-To: <48D44BB27BDE3840BDF18E59CB169A5C012A51E0@bcs-mail3.internal.cacheflow.com> References: <48D44BB27BDE3840BDF18E59CB169A5C012A51E0@bcs-mail3.internal.cacheflow.com> Mime-Version: 1.0 (Apple Message framework v730) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Charles Swiger Date: Fri, 3 Jun 2005 19:55:54 -0400 To: "Li, Qing" X-Mailer: Apple Mail (2.730) Cc: freebsd-net@freebsd.org Subject: Re: issue with route X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2005 23:56:10 -0000 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