C: Extend Semantic support

master
Pierre Neidhardt 2018-11-08 17:26:21 +01:00
parent 051ce2b1f0
commit d22f124507
1 changed files with 17 additions and 10 deletions

View File

@ -141,17 +141,24 @@ You can add your mode hook (e.g. `c-mode-hook')."
(c++-mode . semantic-default-c-setup)))
;;; Make sure Semanticdb folders is set before starting semantic.
(semantic-mode 1)
;; (global-semantic-stickyfunc-mode)
;; (global-semantic-decoration-mode)
;; Eldoc does not work but there is Semantic.
(global-semantic-idle-summary-mode)
;;; Extra semantic support
;;; Example:
;; (when (fboundp 'semantic-add-system-include)
;; (semantic-add-system-include "new/header/dir" 'c++-mode)
;; (add-to-list 'auto-mode-alist (cons qt4-base-dir 'c++-mode))
;; (add-hook
;; 'c++-mode-hook
;; (lambda ()
;; (when semantic-mode
;; (add-to-list 'semantic-lex-c-preprocessor-symbol-file "new/header/dir/config.h")))))
;; Add support for some subdir-includes.
;; TODO: This could be automated by parsing `pkg-config --list-all` or maybe
;; `find -L . -maxdepth 1 -type d`.
(setq semantic-c-dependency-system-include-path
(append (mapcar (lambda (lib)
(expand-file-name
lib
(or (getenv "CPATH")
(if (file-directory-p (expand-file-name "~/.guix-profile/include"))
"~/.guix-profile/include"
"/usr/include"))))
'("glib-2.0" "gtk-3.0" "webkitgtk-4.0"))
'("/usr/include")))
(c-add-style
"ambrevar"