From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Nikolai Weibull Newsgroups: gmane.emacs.devel Subject: Re: C99 compound literals in c-mode Date: Tue, 15 Aug 2017 11:57:25 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1502791106 2104 195.159.176.226 (15 Aug 2017 09:58:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 15 Aug 2017 09:58:26 +0000 (UTC) Cc: Emacs Developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 15 11:58:22 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhYc5-00007S-Je for ged-emacs-devel@m.gmane.org; Tue, 15 Aug 2017 11:58:17 +0200 Original-Received: from localhost ([::1]:49674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhYcC-0007cQ-3R for ged-emacs-devel@m.gmane.org; Tue, 15 Aug 2017 05:58:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dhYbM-0007bA-HO for emacs-devel@gnu.org; Tue, 15 Aug 2017 05:57:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dhYbI-0006zt-IS for emacs-devel@gnu.org; Tue, 15 Aug 2017 05:57:32 -0400 Original-Received: from disu.se ([71.19.156.204]:57482) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dhYbI-0006zf-D4 for emacs-devel@gnu.org; Tue, 15 Aug 2017 05:57:28 -0400 Original-Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by disu.se (Postfix) with ESMTPSA id 1A965C025 for ; Tue, 15 Aug 2017 11:57:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=disu.se; s=mail; t=1502791047; bh=P32L/hK0K7q0dxZIOPplXeWcfLYYs7ZO/9KcaeQ8fZk=; l=790; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=J3OOrHhD+WEmUE1/DzcijKSaw8O8mBiMQvxlel7sPL6OOze/ogkVMUWAbD5gBvUKQ 61odCJWgis2SA5gpfsm7uJ4ldQY3P8gC9Qazpul+5DuGbAsPZa9UyhTZJeYHhDJ8TG UneTqtxcmUuXO86d6zavBAxzjJSHHm0dqZnPhrfE= Original-Received: by mail-wm0-f43.google.com with SMTP id f15so6138197wmg.1 for ; Tue, 15 Aug 2017 02:57:27 -0700 (PDT) X-Gm-Message-State: AHYfb5iJ6natLsf3+9ZdLPLkHG3wNkYYJlHp7eqTysEE4g3JTMsZQvpJ Szhxy1Nbm4VL5dKggWvf9qzl/ZvFjA== X-Received: by 10.80.131.135 with SMTP id 7mr14698325edi.35.1502791045859; Tue, 15 Aug 2017 02:57:25 -0700 (PDT) Original-Received: by 10.80.151.16 with HTTP; Tue, 15 Aug 2017 02:57:25 -0700 (PDT) In-Reply-To: X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 71.19.156.204 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:217565 Archived-At: On Tue, Aug 15, 2017 at 11:03 AM, Stefan Monnier wrote: >> C-mode doesn=E2=80=99t seem to understand C99=E2=80=99s compound literal= s, resulting in >> rather broken indentation. Is this correct and, if so, how difficult wo= uld >> it be to add support for it? > > Could you show some example problematic code? Yes: struct a { int b; }; int main(void) { return (struct a){ 0 }.b; } I use the following style: (c-add-style "now-c-style" '("linux" (c-hanging-braces-alist . ((brace-entry-open) (brace-list-open after) (brace-list-close before) (class-close before) (class-open after) (substatement-open after) (block-close before))) (c-hanging-colons-alist . ((case-label after) (label after))))) Nikolai