lang/cc: conform to new conventions
This commit is contained in:
parent
8482f26d51
commit
60acdcb962
2 changed files with 13 additions and 15 deletions
|
@ -122,7 +122,7 @@ simpler."
|
||||||
;; Hooks
|
;; Hooks
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +cc|fontify-constants ()
|
(defun +cc-fontify-constants-h ()
|
||||||
"Better fontification for preprocessor constants"
|
"Better fontification for preprocessor constants"
|
||||||
(when (memq major-mode '(c-mode c++-mode))
|
(when (memq major-mode '(c-mode c++-mode))
|
||||||
(font-lock-add-keywords
|
(font-lock-add-keywords
|
||||||
|
@ -132,7 +132,7 @@ simpler."
|
||||||
|
|
||||||
(defvar +cc--project-includes-alist nil)
|
(defvar +cc--project-includes-alist nil)
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +cc|init-irony-compile-options ()
|
(defun +cc-init-irony-compile-options-h ()
|
||||||
"Initialize compiler options for irony-mode. It searches for the nearest
|
"Initialize compiler options for irony-mode. It searches for the nearest
|
||||||
compilation database and initailizes it, otherwise falling back on
|
compilation database and initailizes it, otherwise falling back on
|
||||||
`+cc-default-compiler-options' and `+cc-default-include-paths'.
|
`+cc-default-compiler-options' and `+cc-default-include-paths'.
|
||||||
|
|
|
@ -80,7 +80,7 @@ This is ignored by ccls.")
|
||||||
|
|
||||||
;;; Better fontification (also see `modern-cpp-font-lock')
|
;;; Better fontification (also see `modern-cpp-font-lock')
|
||||||
(add-hook 'c-mode-common-hook #'rainbow-delimiters-mode)
|
(add-hook 'c-mode-common-hook #'rainbow-delimiters-mode)
|
||||||
(add-hook! (c-mode c++-mode) #'+cc|fontify-constants)
|
(add-hook! (c-mode c++-mode) #'+cc-fontify-constants-h)
|
||||||
|
|
||||||
;; Custom style, based off of linux
|
;; Custom style, based off of linux
|
||||||
(c-add-style
|
(c-add-style
|
||||||
|
@ -125,18 +125,17 @@ This is ignored by ccls.")
|
||||||
:preface
|
:preface
|
||||||
(setq irony-server-install-prefix (concat doom-etc-dir "irony-server/"))
|
(setq irony-server-install-prefix (concat doom-etc-dir "irony-server/"))
|
||||||
:init
|
:init
|
||||||
(defun +cc|init-irony-mode ()
|
(add-hook! (c-mode-local-vars c++-mode-local-vars objc-mode-local-vars)
|
||||||
|
(defun +cc-init-irony-mode-h ()
|
||||||
(if (file-directory-p irony-server-install-prefix)
|
(if (file-directory-p irony-server-install-prefix)
|
||||||
(irony-mode +1)
|
(irony-mode +1)
|
||||||
(message "Irony server isn't installed")))
|
(message "Irony server isn't installed"))))
|
||||||
(add-hook! (c-mode-local-vars c++-mode-local-vars objc-mode-local-vars)
|
|
||||||
#'+cc|init-irony-mode)
|
|
||||||
:config
|
:config
|
||||||
(setq irony-cdb-search-directory-list '("." "build" "build-conda"))
|
(setq irony-cdb-search-directory-list '("." "build" "build-conda"))
|
||||||
|
|
||||||
;; Initialize compilation database, if present. Otherwise, fall back on
|
;; Initialize compilation database, if present. Otherwise, fall back on
|
||||||
;; `+cc-default-compiler-options'.
|
;; `+cc-default-compiler-options'.
|
||||||
(add-hook 'irony-mode-hook #'+cc|init-irony-compile-options)
|
(add-hook 'irony-mode-hook #'+cc-init-irony-compile-options-h)
|
||||||
|
|
||||||
(def-package! irony-eldoc
|
(def-package! irony-eldoc
|
||||||
:hook (irony-mode . irony-eldoc))
|
:hook (irony-mode . irony-eldoc))
|
||||||
|
@ -182,13 +181,12 @@ This is ignored by ccls.")
|
||||||
:preface
|
:preface
|
||||||
(setq rtags-install-path (concat doom-etc-dir "rtags/"))
|
(setq rtags-install-path (concat doom-etc-dir "rtags/"))
|
||||||
:init
|
:init
|
||||||
(defun +cc|init-rtags ()
|
(add-hook! (c-mode-local-vars c++-mode-local-vars objc-mode-local-vars)
|
||||||
|
(defun +cc-init-rtags-h ()
|
||||||
"Start an rtags server in c-mode and c++-mode buffers."
|
"Start an rtags server in c-mode and c++-mode buffers."
|
||||||
(when (and (require 'rtags nil t)
|
(when (and (require 'rtags nil t)
|
||||||
(rtags-executable-find rtags-rdm-binary-name))
|
(rtags-executable-find rtags-rdm-binary-name))
|
||||||
(rtags-start-process-unless-running)))
|
(rtags-start-process-unless-running))))
|
||||||
(add-hook! (c-mode-local-vars c++-mode-local-vars objc-mode-local-vars)
|
|
||||||
#'+cc|init-rtags)
|
|
||||||
:config
|
:config
|
||||||
(setq rtags-autostart-diagnostics t
|
(setq rtags-autostart-diagnostics t
|
||||||
rtags-use-bookmarks nil
|
rtags-use-bookmarks nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue