radian-software / radian

🍉 Dotfiles that marry elegance and practicality.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

user-error: Company not enabled

haji-ali opened this issue · comments

On a non-customized radian setup, I am getting the error user-error: Company not enabled when I press
M-: (or M-x eval-expression) and press tab after typing anything.

I tried setting debug-on-error, debug-on-message and debug-on-entry so I can capture a call stack without luck.

It seems company does not enable itself when the buffer name starts with a space like the minibuffer (see company-mode-on). But then Radian's remapping of completion-at-point to company-manual-begin is questionable IMO.

I resolved this issue with the following re-mapping instead

(use-package company
  :bind
  ([remap completion-at-point] . #'my/company-completion-at-point)
  :config
  (defun my/company-completion-at-point ()
    (interactive)
    (if company-mode
        (call-interactively 'company-manual-begin)
      ;; if company mode is not enabled call the standard completion-at-point
      (call-interactively 'completion-at-point))))

Hey, thanks for tracking this down! I've had this error for a few years but never bothered to do anything about it. In 87c1ba2, I put the company-manual-begin bindings behind a :filter clause that will activate them only when company-mode is non-nil, which seems to fix the problem.

Yep, that's a much better solution. Thanks!