 
 (require 'company)
 
-(require 'semantic)
-(require 'semantic/ia)
-(require 'semantic/bovine/gcc)
-
-;; http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22287
-(defun semanticdb-save-all-db-idle ()
-  (semantic-safe "Auto-DB Save: %S"
-    ;; FIXME: Use `while-no-input'?
-    (save-mark-and-excursion
-     (semantic-exit-on-input 'semanticdb-idle-save
-       (mapc (lambda (db)
-               (semantic-throw-on-input 'semanticdb-idle-save)
-               (semanticdb-save-db db t))
-             semanticdb-database-list)))))
-
-(global-semanticdb-minor-mode 1)
-(global-semantic-idle-scheduler-mode 1)
-(global-semantic-show-parser-state-mode 1)
-(global-semantic-idle-summary-mode 1)
+(require 'rtags)
+(require 'popup)
+
+(add-to-list 'company-backends 'company-rtags)
+(setq rtags-use-helm t)
+
+;; (require 'semantic)
+;; (require 'semantic/ia)
+;; (require 'semantic/bovine/gcc)
+
+;; ;; http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22287
+;; (defun semanticdb-save-all-db-idle ()
+;;   (semantic-safe "Auto-DB Save: %S"
+;;     ;; FIXME: Use `while-no-input'?
+;;     (save-mark-and-excursion
+;;      (semantic-exit-on-input 'semanticdb-idle-save
+;;        (mapc (lambda (db)
+;;                (semantic-throw-on-input 'semanticdb-idle-save)
+;;                (semanticdb-save-db db t))
+;;              semanticdb-database-list)))))
+
+;; (global-semanticdb-minor-mode 1)
+;; (global-semantic-idle-scheduler-mode 1)
+;; (global-semantic-show-parser-state-mode 1)
+;; (global-semantic-idle-summary-mode 1)
 ;; (global-semantic-show-unmatched-syntax-mode 1)
 
-(when (kelly?)
-  (progn
-    (semantic-add-system-include "~" 'c++-mode)
-    (semantic-add-system-include "~/ido" 'c++-mode)
-    (semantic-add-system-include "~/sklad-dist/include" 'c++-mode)
-    (setq semantic-c-obey-conditional-section-parsing-flag nil)))
+;; (when (kelly?)
+;;   (progn
+;;     (semantic-add-system-include "~" 'c++-mode)
+;;     (semantic-add-system-include "~/ido" 'c++-mode)
+;;     (semantic-add-system-include "~/sklad-dist/include" 'c++-mode)
+;;     (setq semantic-c-obey-conditional-section-parsing-flag nil)))
 
 ;; (semantic-add-system-include "/usr/local/include" 'c++-mode)
 
-(semantic-mode 1)   ;; + semantic-force-refresh
-(setq-default semanticdb-project-root-functions
-              projectile-project-root-files-functions)
+;; (semantic-mode 1)   ;; + semantic-force-refresh
+;; (setq-default semanticdb-project-root-functions
+;;               projectile-project-root-files-functions)
+
+(defun my-imenu ()
+  (interactive)
+  (if (rtags-is-indexed)
+      (rtags-imenu)
+    (helm-semantic-or-imenu nil)))
 
 (defun my-prog-mode-hook ()
   (highlight-symbol-mode)

             (local-set-key (kbd "<tab>") 'bbdb-complete-mail)))

(set-background-color "gray85")

(set-face-attribute 'helm-source-header
                    nil

                    nil
                    :background "gray80"
                    :box '(:line-width -1 :style released-button))

(set-face-attribute 'rtags-skippedline
                    nil
                    :background "gray80")

(set-face-attribute 'rtags-warnline
                    nil
                    :background "#ccccff")
