all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Nikolai Weibull <now@disu.se>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	Emacs Developers <emacs-devel@gnu.org>
Subject: Re: C99 compound literals in c-mode
Date: Wed, 16 Aug 2017 17:26:04 +0000	[thread overview]
Message-ID: <20170816172604.GD3417@ACM> (raw)
In-Reply-To: <CADdV=MtiJ1MXLu34BTp-h1mOxe1C0Wc2XZw2MJufY3GwGzQ5aQ@mail.gmail.com>

Hello, Nikolai.

On Tue, Aug 15, 2017 at 11:57:25 +0200, Nikolai Weibull wrote:
> On Tue, Aug 15, 2017 at 11:03 AM, Stefan Monnier
> <monnier@iro.umontreal.ca> wrote:
> >> C-mode doesn’t seem to understand C99’s compound literals, resulting in
> >> rather broken indentation.  Is this correct and, if so, how difficult would
> >> 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'll take a look at it.  It shouldn't be too difficult.

> 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

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2017-08-16 17:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15  8:04 C99 compound literals in c-mode Nikolai Weibull
2017-08-15  9:03 ` Stefan Monnier
2017-08-15  9:56   ` Nikolai Weibull
2017-08-15  9:57   ` Helmut Eller
2017-08-15  9:57   ` Nikolai Weibull
2017-08-16 17:26     ` Alan Mackenzie [this message]
2017-08-16 17:52       ` Nikolai Weibull
2017-08-20 20:40     ` Alan Mackenzie
2017-08-23 10:01       ` Nikolai Weibull
2017-08-24 16:37         ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170816172604.GD3417@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=now@disu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.