From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gregory Fong Newsgroups: gmane.emacs.help Subject: Re: continuing indentation in for loop condition in cc-mode Date: Fri, 12 Feb 2016 18:18:31 -0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1455333275 18577 80.91.229.3 (13 Feb 2016 03:14:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Feb 2016 03:14:35 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: embe8573@student.uu.se Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 13 04:14:34 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aUQfI-0001Ul-Gw for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Feb 2016 04:14:32 +0100 Original-Received: from localhost ([::1]:38557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUQfH-0001KD-CY for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Feb 2016 22:14:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUPnb-0006zF-1Y for help-gnu-emacs@gnu.org; Fri, 12 Feb 2016 21:19:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUPnZ-0006wk-VU for help-gnu-emacs@gnu.org; Fri, 12 Feb 2016 21:19:02 -0500 Original-Received: from mail-io0-x22f.google.com ([2607:f8b0:4001:c06::22f]:36484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUPnZ-0006wf-QA for help-gnu-emacs@gnu.org; Fri, 12 Feb 2016 21:19:01 -0500 Original-Received: by mail-io0-x22f.google.com with SMTP id l127so109543051iof.3 for ; Fri, 12 Feb 2016 18:19:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=Qxj7gg4aKWOKPjBNTxqoYdqV7+hCErMccHEmV6be3Ws=; b=hNMeA+LWp4F/Nw2ABHKfN05hgIeWbkexHrBHyPT4klHxH10WbHkBhW3lYC1uMdvw3M sbc5s/br/qBq+VHHQ8+wpFxp2sdTe3FdZbAHY5Xg3Z5UVUyyrFA86N4Xpcxdq/l1zw4H Bi4gJFEhKmppAMZWc63urKMR/nuzy7vJKmD2toBi4lnJSz4s6O3fqoeOcUA2s2wOyutF /9ueByoWZDFXFN8EDbhIricHiKJpaQsPpLKZx6vxJ9HUDLBj45osXOdh6Z6WIpGlYw18 A5ADMQBZgd3NMRXUmq+YcErLFljMvVvzN2PJ7J2vWp0tbQNa0sD3jduxe1COsLsRrAhp JlcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-type; bh=Qxj7gg4aKWOKPjBNTxqoYdqV7+hCErMccHEmV6be3Ws=; b=UKLo4PXgV5VeIpMCGojtl9yFSgitcDeUBQtd/DipIsxd8KMwsE7ZtLiu74S2EXAPcA w0i5zFaCY/5luvLkvwo+NKMFzzVi2b8aHF5VeDBz48OoqUjw159/ms7hWSqL91tUVRwD baOim7GeaCrc2DNuBTCsI09vLrdwPpvc+SYC8ApAWgt0w681GNuaj8uh30A7vqliN4yn X0XbUAtJ5iNYtl8pjbvwZNkMrcgw1Oq5Na4h1/zRZgXxdwgeG7X+JuafC34sitvC5Knb Z5wWrTrWKJJvLX5gwfHKIjKZSXGroNjRGBPav43oIfLJMXUa4gybka92dVw20T3WT9pp 497g== X-Gm-Message-State: AG10YOQSC06ueU5XCaPr8a/gBfS6/pVmwrDozLzYgG919iHWgZGUJSFCUoYNs8LR7SgJWHw3ZcZeSR9uf87qCA== X-Received: by 10.107.15.223 with SMTP id 92mr6135537iop.3.1455329940999; Fri, 12 Feb 2016 18:19:00 -0800 (PST) Original-Received: by 10.64.227.131 with HTTP; Fri, 12 Feb 2016 18:18:31 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c06::22f X-Mailman-Approved-At: Fri, 12 Feb 2016 22:14:14 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109155 Archived-At: (sorry if you get this twice, I didn't realize I wasn't subscribed to the list, tried to send using gmane, then that didn't work, so now I'm just using the reply mailto button from the archive, which might break the thread) Emanuel Berg student.uu.se> writes: > Gregory Fong gmail.com> writes: > > for (int i = 0; > > i < 5; > > ++i) > > { > > } > > > > but I can't seem to find an offset that adjusts this > > parameter. c-show-syntatic information just shows > > these as being a statement. > > > > Emacs will default to align with the first item in > > the condition: > > > > for (int i = 0; > > i < 5; > > ++i) > > { > > } > > > > I can't imagine that I'm the only person who has > > tried to change this, but it's surprisingly > > difficult to search for answers. > > Why is that so surprising? I'd say most people would > agree with the Emacs default. > > Doesn't it make the most sense as well? I personally like the default. Unfortunately, the company I work for uses the style I mentioned at the top. This is mostly surprising to me because it's really the only indentation issue I've ever run into using emacs. Everything else has been customizable regardless of whatever bizarro coding standard I've had to use, which is impressive. > > And, for such a basic for loop, why not put everything > on the same line? > > for (int i = 0; i < ARRAY_SIZE; i++) { > ... > } > Yes, that was a poor example. I was thinking more of the sorts of long lines you tend to get when working in C++ with iterators, in which case I'm trying to get it to look like this: for (auto iter = RidiculouslyLongClassName.begin(); iter < RidiculouslyLongClassName.end(); ++iter) { ... } As it is right now, I keep having to remember to fix the indentation manually, which has been driving me nuts. If there's a known way to change this behavior, or if you have an idea on where to start looking at how to do this, I'd love to hear it. Just not sure where to start. Thanks and regards, Gregory