From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#18158: Fix extra indent of d-mode "else static if" statements in cc-engine.el Date: Fri, 31 Jan 2020 19:41:03 +0000 Message-ID: <20200131194103.GA5872@ACM> References: <87blqxq12q.fsf@marxist.se> <20200126152931.GA4829@ACM> <8B3ABB9B-7A39-428A-A65B-B77D0614C9FE@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="68012"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 18158@debbugs.gnu.org, Stefan Kangas To: Liran Zvibel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 31 20:42:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ixcB9-000Hdz-5e for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Jan 2020 20:42:11 +0100 Original-Received: from localhost ([::1]:58688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixcB8-0004bA-1o for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Jan 2020 14:42:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58293) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixcB1-0004b3-3P for bug-gnu-emacs@gnu.org; Fri, 31 Jan 2020 14:42:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixcB0-0003oT-68 for bug-gnu-emacs@gnu.org; Fri, 31 Jan 2020 14:42:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60384) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ixcB0-0003oL-2m; Fri, 31 Jan 2020 14:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ixcB0-0003WN-0k; Fri, 31 Jan 2020 14:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Fri, 31 Jan 2020 19:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18158 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 18158-submit@debbugs.gnu.org id=B18158.158049967013469 (code B ref 18158); Fri, 31 Jan 2020 19:42:01 +0000 Original-Received: (at 18158) by debbugs.gnu.org; 31 Jan 2020 19:41:10 +0000 Original-Received: from localhost ([127.0.0.1]:38124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ixcA9-0003VB-UC for submit@debbugs.gnu.org; Fri, 31 Jan 2020 14:41:10 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:54574 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1ixcA7-0003V1-Gf for 18158@debbugs.gnu.org; Fri, 31 Jan 2020 14:41:08 -0500 Original-Received: (qmail 45785 invoked by uid 3782); 31 Jan 2020 19:41:05 -0000 Original-Received: from acm.muc.de (p4FE15D3F.dip0.t-ipconnect.de [79.225.93.63]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 31 Jan 2020 20:41:03 +0100 Original-Received: (qmail 5893 invoked by uid 1000); 31 Jan 2020 19:41:03 -0000 Content-Disposition: inline In-Reply-To: <8B3ABB9B-7A39-428A-A65B-B77D0614C9FE@gmail.com> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175525 Archived-At: Hello, Liran. Many thanks for the sample D file. I can indeed reproduce the problem, and I'm looking into ways of fixing it properly, thus removing the need for the workarounds which have found their way into d-mode.el. On Tue, Jan 28, 2020 at 17:26:41 -0800, Liran Zvibel wrote: > @("notrace") JSONValue objToJSON(T)(auto ref const T obj) @trusted { > alias U = Unqual!T; > static if (is(U == JSONValue)) { > return obj; > } > else static if (__traits(compiles, obj.toJSON())) { > return obj.toJSON(); > } > else static if (is(U == typeof(null))) { [ .... ] > } > } > } > : > > On Jan 26, 2020, at 7:29 AM, Alan Mackenzie wrote: > > Hello, Stefan and Liran. > > On Mon, Jan 20, 2020 at 22:18:05 +0100, Stefan Kangas wrote: > >> Hi Alan, > >> Could you please help review also the below patch for cc-engine.el? > > I'm less than happy about putting a special purpose workaround into a > > critical bit of CC Mode (c-add-stmt-syntax) without having even seen the > > problem. > > Liran, if you're still there and still interested, could you possibly > > supply me with a sample of D source code containing the problem? I > > would hope to be able to enhance CC Mode to handle it in a more general > > and useful fashion. -- Alan Mackenzie (Nuremberg, Germany).