From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: nullius.filius@gmail.com Newsgroups: gmane.emacs.help Subject: cc-mode and continuing a for loop statement over two lines Date: Wed, 27 Feb 2008 22:40:24 -0800 (PST) Organization: http://groups.google.com Message-ID: <93884796-53ce-4f0e-98d6-afb1ab508022@s13g2000prd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204210357 14491 80.91.229.12 (28 Feb 2008 14:52:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2008 14:52:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 28 15:53:03 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JUk85-0002MN-1L for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Feb 2008 15:53:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUk7W-0004yD-2t for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Feb 2008 09:52:26 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!s13g2000prd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 63 Original-NNTP-Posting-Host: 60.230.231.241 Original-X-Trace: posting.google.com 1204180824 5692 127.0.0.1 (28 Feb 2008 06:40:24 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 28 Feb 2008 06:40:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s13g2000prd.googlegroups.com; posting-host=60.230.231.241; posting-account=eC1DvgoAAADSFXX7sf_iRJJOD8mR2PMk User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:156559 X-Mailman-Approved-At: Thu, 28 Feb 2008 09:50:40 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:51944 Archived-At: I would like to indent twice if I have to continue a for loop statement onto more than one line. For example, as in the following code- for (vector::iterator iter(data.begin()); iter != data.end(); ++iter) { // do something } This is so cc-mode formats like the ANSI predefined style in astyle. This is the code in my dot emacs (boosted from elsewhere). I have not found a variable for tweaking continuation lines from inside for loop statements. ------------------------------------------------------------------------ (defconst c-indentation 4) (defvar my-c-style `((c-basic-offset . ,c-indentation) (c-tab-always-indent . t) (c-comment-only-line-offset . 0) (c-hanging-braces-alist . ((substatement-open . (before after)) (brace-list-open) (brace-list-close) (brace-list-intro) (brace-entry-open))) (c-hanging-colons-alist . ((member-init-intro before) (inher-intro) (case-label after) (label after) (access-label after))) (c-cleanup-list . (scope-operator empty-defun-braces defun-close-semi)) (c-offsets-alist . ((arglist-close . c-lineup-arglist-close-under- paren) (substatement-open . 0) (innamespace . nil) (label . nil) (block-open . 0) (inline-open . 0) (template-args-cont . c-lineup-template-args) (inher-cont . c-lineup-multi- inher) (statement-cont . (c-lineup-math ++)) (knr-argdecl-intro . -))) (c-echo-syntactic-information-p . t) ) "My C Programming Style") (defun my-c-mode-common-hook () (c-add-style "PERSONAL" my-c-style t)) (add-hook 'c++-mode-hook 'my-c-mode-common-hook) ------------------------------------------------------------------------