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

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

Re: Modify indention for C/C++


From: Florian Lindner
Subject: Re: Modify indention for C/C++
Date: Wed, 11 Jun 2014 16:23:41 +0200
User-agent: Roundcube Webmail/1.0.1

Am 11.06.2014 15:42, schrieb Teemu Likonen:
Florian Lindner [2014-06-11 15:24:34 +02:00] wrote:

what is the canonical way to modify indention for certain keywords?
I've found numerous ways in the internets. I want to change the linux
style so, that is does not do indention for namespaces.

(c-add-style "linux"
             '(
               (c-basic-offset . 2)
               (c-offset-alist . (
                                  (namespace-open . 0)
                                  (namespace-close . 0)
                                  (innamespace . 0)
                                  ))
               ))

How about this?

    (c-add-style "my-linux"
                 '("linux"
                   (c-basic-offset . 2)
                   (c-offset-alist (namespace-open . 0)
                                   (namespace-close . 0)
                                   (innamespace . 0))))

This adds "my-linux" style, so the original is not overwritten.

c-style-alist now has an entry:

 ("my-linux" "linux"
  (c-basic-offset . 2)
  (c-offset-alist
   (namespace-open . 0)
   (namespace-close . 0)
   (innamespace . 0)))

Does that mean the mode is derived from linux?

Indention is still the same, after a namespace code is being indented. I've activated the my-linux style.

Thx,
Florian



reply via email to

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