From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: [handa@m17n.org: C indentation problem] Date: Tue, 21 May 2019 12:00:22 +0000 Message-ID: <20190521120021.GB4706@ACM> References: <87muk7hc46.fsf@tcd.ie> <20190521103254.GA4706@ACM> <877eak2hy1.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="203059"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 21 14:03:39 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hT3UZ-000qhv-8w for ged-emacs-devel@m.gmane.org; Tue, 21 May 2019 14:03:39 +0200 Original-Received: from localhost ([127.0.0.1]:52422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT3UY-0005Ul-AG for ged-emacs-devel@m.gmane.org; Tue, 21 May 2019 08:03:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hT3RY-00042B-UB for emacs-devel@gnu.org; Tue, 21 May 2019 08:00:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hT3RU-0005nO-1Z for emacs-devel@gnu.org; Tue, 21 May 2019 08:00:32 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:39048 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hT3RT-0005kY-NS for emacs-devel@gnu.org; Tue, 21 May 2019 08:00:27 -0400 Original-Received: (qmail 29423 invoked by uid 3782); 21 May 2019 12:00:23 -0000 Original-Received: from acm.muc.de (p4FE15C6E.dip0.t-ipconnect.de [79.225.92.110]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 21 May 2019 14:00:22 +0200 Original-Received: (qmail 6749 invoked by uid 1000); 21 May 2019 12:00:22 -0000 Content-Disposition: inline In-Reply-To: <877eak2hy1.fsf@tcd.ie> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236856 Archived-At: Hello, Basil. On Tue, May 21, 2019 at 11:57:42 +0100, Basil L. Contovounesios wrote: > Alan Mackenzie writes: > >> CC Mode 5.33.2 also indents "Emacs 22-style", i.e. to 5 columns, but the > >> current sources, AFAICS, are indented to 2 columns, "Emacs 21-style". > > More to the point, we no longer have knr declarations. > >> Shouldn't the now-existing c-lineup-gnu-DEFUN-intro-cont be changed > >> accordingly, to indent to 2 columns instead of 5? > > Seeing as how we don't have knr declarations any more, it seems senseless > > now to indent with the CC Mode syntactic symbol knr-argdecl-intro, i.e. > > 5. Instead c-basic-offset (2) seems right. > > How about the following patch? > > diff -r f9e4e46ed54d cc-align.el > > --- a/cc-align.el Mon May 20 12:34:51 2019 +0000 > > +++ b/cc-align.el Tue May 21 10:24:11 2019 +0000 > > @@ -112,7 +112,7 @@ > > (let (case-fold-search) > > (goto-char (c-langelem-pos langelem)) > > (if (looking-at "\\") > > - (c-calc-offset '(knr-argdecl-intro)))))) > > + c-basic-offset)))) > > (defun c-block-in-arglist-dwim (arglist-start) > > ;; This function implements the DWIM to avoid far indentation of > LGTM, thanks. Thanks, I've committed it (with amendments to the doc string). > -- > Basil -- Alan Mackenzie (Nuremberg, Germany).