emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C99 compound literals in c-mode


From: Alan Mackenzie
Subject: Re: C99 compound literals in c-mode
Date: Wed, 16 Aug 2017 17:26:04 +0000
User-agent: Mutt/1.7.2 (2016-11-26)

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
> <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]