From: Dmitry Gutov Date: Wed, 8 Oct 2014 03:29:16 +0000 (+0400) Subject: company-dabbrev--search: Ignore "uninteresting" buffers X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/b6b2ba50f36831e9eb63d96b0655235ce7141388?hp=25ec988128e13369bc9c2396524dda6551427447 company-dabbrev--search: Ignore "uninteresting" buffers Closes #199 --- diff --git a/NEWS.md b/NEWS.md index 9744dede1..6766eb224 100644 --- 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. diff --git a/company-dabbrev.el b/company-dabbrev.el index 84da3059e..fa286116c 100644 --- a/company-dabbrev.el +++ b/company-dabbrev.el @@ -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))))