lang/cc: minor refactor
This commit is contained in:
parent
ad013e96dd
commit
d600d36675
1 changed files with 13 additions and 13 deletions
|
@ -1,8 +1,8 @@
|
|||
;;; lang/cc/config.el --- c, c++, and obj-c -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +cc-include-paths (list "include/")
|
||||
"A list of paths, relative to a project root, to search for headers in
|
||||
C/C++. Paths can be absolute.
|
||||
"A list of paths, relative to a project root, to search for headers in C/C++.
|
||||
Paths can be absolute.
|
||||
|
||||
The purpose of this variable is to ensure syntax checkers and code-completion
|
||||
knows where to look for headers.")
|
||||
|
@ -13,8 +13,8 @@ knows where to look for headers.")
|
|||
. ,(list "-std=c++11" ; use C++11 by default
|
||||
(when IS-MAC
|
||||
;; NOTE beware: you'll get abi-inconsistencies when passing
|
||||
;; std-objects to libraries linked with libstdc++ (e.g. if you use
|
||||
;; boost which wasn't compiled with libc++)
|
||||
;; std-objects to libraries linked with libstdc++ (e.g. if you
|
||||
;; use boost which wasn't compiled with libc++)
|
||||
(list "-stdlib=libc++"))))
|
||||
(objc-mode . nil))
|
||||
"A list of default compiler options for the C family. These are ignored if a
|
||||
|
@ -45,7 +45,7 @@ compilation database is present in the project.")
|
|||
(equal (file-name-extension buffer-file-name) "h")
|
||||
(re-search-forward "@\\<interface\\>" magic-mode-regexp-match-limit t)))
|
||||
|
||||
(push (cons #'+cc-c++-header-file-p 'c++-mode) magic-mode-alist)
|
||||
(push (cons #'+cc-c++-header-file-p 'c++-mode) magic-mode-alist)
|
||||
(push (cons #'+cc-objc-header-file-p 'objc-mode) magic-mode-alist)
|
||||
|
||||
:init
|
||||
|
@ -62,14 +62,14 @@ compilation database is present in the project.")
|
|||
;; C/C++ style settings
|
||||
(c-toggle-electric-state -1)
|
||||
(c-toggle-auto-newline -1)
|
||||
(c-set-offset 'substatement-open '0) ; brackets should be at same indentation level as the statements they open
|
||||
(c-set-offset 'inline-open '+)
|
||||
(c-set-offset 'block-open '+)
|
||||
(c-set-offset 'brace-list-open '+) ; all "opens" should be indented by the c-indent-level
|
||||
(c-set-offset 'case-label '+) ; indent case labels by c-indent-level, too
|
||||
(c-set-offset 'access-label '-)
|
||||
(c-set-offset 'arglist-intro '+)
|
||||
(c-set-offset 'arglist-close '0)
|
||||
(c-set-offset 'substatement-open '0) ; don't indent brackets
|
||||
(c-set-offset 'inline-open '+)
|
||||
(c-set-offset 'block-open '+)
|
||||
(c-set-offset 'brace-list-open '+)
|
||||
(c-set-offset 'case-label '+)
|
||||
(c-set-offset 'access-label '-)
|
||||
(c-set-offset 'arglist-intro '+)
|
||||
(c-set-offset 'arglist-close '0)
|
||||
;; Indent privacy keywords at same level as class properties
|
||||
;; (c-set-offset 'inclass #'+cc-c-lineup-inclass)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue