Remove company-semantic to conform with Spacemacs

Since Spacemacs set the idle delay to 0.0 for continuous completion
offering, it is too much for backend like company-semantic, and probably
other backends that require long processing time that should only be
initiated when user is actually idle. company-semantic is not compatible
with Spacemacs overall, so we should remove it otherwise it hangs
Emacs.
This commit is contained in:
Tu Do 2015-03-20 17:25:07 +07:00 committed by syl20bnr
parent 6310165b1d
commit a173d07252

View file

@ -11,7 +11,9 @@
"Packages that use auto-complete that are no longer necessary and might conflict.") "Packages that use auto-complete that are no longer necessary and might conflict.")
(defun company-mode/backend-with-yas (backend) (defun company-mode/backend-with-yas (backend)
(if (or (not company-mode-enable-yas) (and (listp backend) (member 'company-yasnippet backend))) (if (or (not company-mode-enable-yas)
(and (listp backend) (member 'company-yasnippet backend))
(eq 'company-semantic backend))
backend backend
(append (if (consp backend) backend (list backend)) (append (if (consp backend) backend (list backend))
'(:with company-yasnippet)))) '(:with company-yasnippet))))
@ -30,8 +32,8 @@ so that you don't have 'do' completed to 'downcase' in Ruby"
(setq (setq
company-transformers '(company-mode/keyword-cancel-transformer company-sort-by-occurrence)) company-transformers '(company-mode/keyword-cancel-transformer company-sort-by-occurrence))
) )
(setq company-transformers '(company-sort-by-occurrence)) ;else (setq company-transformers '(company-sort-by-occurrence)) ;else
) )
(setq company-idle-delay 0.0 (setq company-idle-delay 0.0
company-minimum-prefix-length 2 company-minimum-prefix-length 2
@ -58,6 +60,13 @@ so that you don't have 'do' completed to 'downcase' in Ruby"
(setq company-backends (mapcar #'company-mode/backend-with-yas company-backends)) (setq company-backends (mapcar #'company-mode/backend-with-yas company-backends))
;; remove company-semantic since the value 0.0 is too low for Semantic to
;; finish its job and make Emacs hanging due to company-semantic
;; constantly requests Semantic to parse. We must remove it or change
;; delay value. The delay value is more useful in other places, so we
;; remove company-semantic
(setq company-backends (remove 'company-semantic company-backends))
(spacemacs|diminish company-mode "" " C")))) (spacemacs|diminish company-mode "" " C"))))
(defun company-mode/init-company-c-headers () (defun company-mode/init-company-c-headers ()