From 73ecbcd2c3d206fc9a5442881595e1eab4a366ab Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 21 Apr 2017 15:48:02 -0400 Subject: [PATCH] Update semantic config - simplify modes - inhibit outside cc and java modes - bind M-. to semantic-ia-fast-jump in cc-mode --- .emacs.d/init.el | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index fc9e170..b111fae 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -115,15 +115,24 @@ (use-package semantic :defer :init - (add-hook 'c-mode-hook (lambda () - (semantic-mode 1))) + (add-hook 'c-mode-hook 'semantic-mode) :config - (global-semantic-decoration-mode 1) - (global-semantic-highlight-func-mode 1) - (global-semantic-show-unmatched-syntax-mode 1) - (global-semantic-idle-summary-mode 1) - (global-semantic-stickyfunc-mode 1) - (setq semantic-idle-scheduler-idle-time 0.1)) + (setq semantic-default-submodes '(global-semantic-idle-scheduler-mode + global-semanticdb-minor-mode + global-semantic-decoration-mode + global-semantic-highlight-func-mode + global-semantic-show-unmatched-syntax-mode + global-semantic-idle-summary-mode + global-semantic-stickyfunc-mode + global-semantic-idle-local-symbol-highlight-mode) + semantic-idle-scheduler-idle-time 0.2) + + ; inhibit semantic outside of specific modes + (add-to-list 'semantic-inhibit-functions + #'(lambda () (not (member major-mode '(cc-mode java-mode))))) + + (eval-after-load "cc-mode" + '(define-key c-mode-map (kbd "M-.") 'semantic-ia-fast-jump))) (use-package term :config