syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.58k stars 4.9k forks source link

tell company-dabbrev to only consider same-mode buffers #16309

Closed dankessler closed 3 months ago

dankessler commented 4 months ago

See #11743 for a well-argued criticism of company-dabbrev's tendency to over-zealously suggest useless completions.

With many buffers open, many of the completions offered by company-dabbrev can be nonsense. For example, if a magit log happens to be open, then many of the suggested completions may be hashes of commits, and if a PDF is open, many of the completions will be nonsense strings that include control characters.

This PR sets company-dabbrev-other-buffers to t which means that company-dabbrev should only search for completions in other buffers with the same major mode. This should significantly cut down on the noise without going quite so far as suggested in #11743 and removing company-dabbrev as a backend entirely