lang/cc: minor refactor

This commit is contained in:
Henrik Lissner 2017-09-20 14:25:35 +02:00
parent ad013e96dd
commit d600d36675
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -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
@ -62,11 +62,11 @@ 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 'substatement-open '0) ; don't indent brackets
(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 'brace-list-open '+)
(c-set-offset 'case-label '+)
(c-set-offset 'access-label '-)
(c-set-offset 'arglist-intro '+)
(c-set-offset 'arglist-close '0)