hylang / hy-mode

Hy mode for Emacs
GNU General Public License v3.0
191 stars 47 forks source link

hy-mode: Symbol’s value as variable is void: company-backends #92

Closed tgbugs closed 4 years ago

tgbugs commented 4 years ago

When trying to start hy-mode I was getting the following error. hy-mode: Symbol’s value as variable is void: company-backends.

Changing hy-mode--support-company from

(defun hy-mode--support-company ()
  "Support `company-mode' autocompletion."
  (add-to-list 'company-backends #'company-hy))

to

(defun hy-mode--support-company ()
  "Support `company-mode' autocompletion."
  (when (boundp 'company-backends)
        (add-to-list 'company-backends #'company-hy)))

fixed the issue for me, but I'm not sure if that is really the correct fix, so submitting this issue.