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

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to