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.57k stars 4.9k forks source link

[auto-completion] Fix company-backends nil when scratch buffer enables completion #16321

Closed bcc32 closed 3 months ago

bcc32 commented 3 months ago

Fix #16320

make-variable-buffer-local should not be called on a variable where it is used, only where it is defined (see its docstring). When the variable is unbound at the time make-variable-buffer-local is called, the toplevel default value gets set to nil, which causes the variable to remain nil in all buffers once company.el (which contains the defcustom for company-backends) is loaded.