]> code.delx.au - gnu-emacs-elpa/commitdiff
global-company-mode: don't turn on in invisible buffers
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 17 Mar 2013 22:47:35 +0000 (02:47 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 17 Mar 2013 22:48:57 +0000 (02:48 +0400)
Before: (js2-time (with-temp-buffer (fundamental-mode))) => 0.0282
After:  (js2-time (with-temp-buffer (fundamental-mode))) => 0.0018

company.el

index cebd6cab8819be922f84549415fdc6a37cab19ba..a841f98f41fe0603a5bcce15bafa85f9455722fa 100644 (file)
@@ -76,7 +76,7 @@
 ;;    used, so, for example, it's not as easy to circumvent `paredit-mode'
 ;;    accidentally when it's enabled.
 ;;    Fixed two old tooltip annoyances.
-;;    Improved tooltip performance.
+;;    Some performance improvements.
 ;;
 ;; 2010-02-24 (0.5)
 ;;    `company-ropemacs' now provides location and docs.  (Fernando H. Silva)
@@ -622,7 +622,8 @@ keymap during active completions (`company-active-map'):
     (kill-local-variable 'company-point)))
 
 (define-globalized-minor-mode global-company-mode company-mode
-  (lambda () (company-mode 1)))
+  (lambda () (unless (or noninteractive (eq (aref (buffer-name) 0) ?\s))
+          (company-mode 1))))
 
 (defsubst company-assert-enabled ()
   (unless company-mode