]> code.delx.au - gnu-emacs-elpa/commitdiff
company-dabbrev--search: Ignore "uninteresting" buffers
authorDmitry Gutov <dgutov@yandex.ru>
Wed, 8 Oct 2014 03:29:16 +0000 (07:29 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Wed, 8 Oct 2014 03:29:16 +0000 (07:29 +0400)
Closes #199

NEWS.md
company-dabbrev.el

diff --git a/NEWS.md b/NEWS.md
index 9744dede1b8f58c099ee0861f643a809d7e48c95..6766eb2240d2893809ea1b40c33193e16a23e44b 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* `company-dabbrev` always ignores "uninteresting" buffers.
 * `company-files` checks directory's last modification time.
 * `company-files` supports relative paths and Windows drive letters.
 
index 84da3059e6048b1dc3a944b59d32e2ea5431ab70..fa286116c871ba8aa4098d0c2780344df4f0cc8d 100644 (file)
@@ -121,8 +121,9 @@ This variable affects both `company-dabbrev' and `company-dabbrev-code'."
     (when other-buffer-modes
       (cl-dolist (buffer (delq (current-buffer) (buffer-list)))
         (with-current-buffer buffer
-          (when (or (eq other-buffer-modes 'all)
-                    (apply #'derived-mode-p other-buffer-modes))
+          (when (if (eq other-buffer-modes 'all)
+                    (not (string-match-p "\\`[ *]" (buffer-name)))
+                  (apply #'derived-mode-p other-buffer-modes))
             (setq symbols
                   (company-dabbrev--search-buffer regexp nil symbols start
                                                   limit ignore-comments))))