(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(current-language-environment "UTF-8"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; if you want to enable support for gnu global
(require 'semanticdb-global)
;;(global-semantic-folding-mode 1)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
;; enable ctags for some languages:
;; Unix Shell, Perl, Pascal, Tcl, Fortran, Asm
;;(semantic-load-enable-primary-exuberent-ctags-support)
(require 'semantic-decorate-include)
;; gcc setup
(require 'semantic-gcc)
;; smart complitions
(require 'semantic-ia)
(setq-mode-local c-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(setq-mode-local c++-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
(setq-mode-local erlang-mode semanticdb-find-default-throttle
'(project unloaded system recursive))
;; ede customization
(require 'semantic-lex-spp)
(global-ede-mode t)
;; my functions for EDE
(defun my-ede-get-local-var (fname var)
"fetch given variable var from :local-variables of project of file fname"
(let* ((current-dir (file-name-directory fname))
(prj (ede-current-project current-dir)))
(when prj
(let* ((ov (oref prj local-variables))
(lst (assoc var ov)))
(when lst
(cdr lst))))))
;; setup compile package
;; TODO: allow to specify function as compile-command
(require 'compile)
(setq compilation-disable-input nil)
(setq compilation-scroll-output t)
(setq mode-compile-always-save-buffer-p t)
(defun My-Compile ()
"Saves all unsaved buffers, and runs 'compile'."
(interactive)
(save-some-buffers t)
(compile (or (my-ede-get-local-var (buffer-file-name (current-buffer)) 'compile-command)
compile-command)))