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: Sat, 13 Feb 2016 01:00:35 +0000 (UTC) Message-ID: References: <87k2mimu4n.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1455333286 18606 80.91.229.3 (13 Feb 2016 03:14:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Feb 2016 03:14:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 13 04:14:37 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 1aUQfM-0001WX-SK for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Feb 2016 04:14:37 +0100 Original-Received: from localhost ([::1]:38560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUQfL-0001Oq-NP for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Feb 2016 22:14:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUOe8-0000VO-7G for help-gnu-emacs@gnu.org; Fri, 12 Feb 2016 20:05:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUOe5-0007m4-1z for help-gnu-emacs@gnu.org; Fri, 12 Feb 2016 20:05:12 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:54218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUOe4-0007lD-Pk for help-gnu-emacs@gnu.org; Fri, 12 Feb 2016 20:05:08 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aUOe0-0001A4-6c for help-gnu-emacs@gnu.org; Sat, 13 Feb 2016 02:05:04 +0100 Original-Received: from cpe-98-148-132-5.socal.res.rr.com ([98.148.132.5]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Feb 2016 02:05:04 +0100 Original-Received: from gregory.0xf0 by cpe-98-148-132-5.socal.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Feb 2016 02:05:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 71 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 98.148.132.5 (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:109156 Archived-At: 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