help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: don't indent on nested namespaces in c++ mode


From: Óscar Fuentes
Subject: Re: don't indent on nested namespaces in c++ mode
Date: Thu, 26 Feb 2015 16:35:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Glen Stark <mail@glenstark.net> writes:

> Hi everyone.   I'm in Emacs 24.4.1.    I am able to get zero indentation 
> on nested namespaces, if they are declared on separate lines, but not if 
> they are on a single line.  
>
> I have the following line in my configuration:
>
>   (c-set-offset 'innamespace 0)
>
> Which produces the desired result for:
>
>    namespace foo{
>    namespace bar{
>    class foobar{};
>    }
>
> But when I have nested namespaces declared on a single line it
>  produces the undesired:      
>    namespace foo{ namespace bar{
>        class foobar{};
>    }
>
>
> I've also tried the following (which I got from stack overflow), but it 
> seems to have no effect whatsoever:
>    (defconst my-cc-style
>      '("cc-mode"
>        (c-offsets-alist . ((innamespace . [0])))))
>
>    (c-add-style "my-cc-mode" my-cc-style)
>
>
> Can anyone explain what's going on, and tell me how to get the desired 
> effect?

I cannot replicate your problem with my config. My style has (among
many other things)

    (innamespace . -)




reply via email to

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