In my dot-emacs I have the following backend for Company:

 (add-to-list 'company-backends 'company-dabbrev t)

In Eshell, I use another company backends. So it's configured as the following:

 (add-hook 'eshell-mode-hook
        (lambda ()
          (set (make-local-variable 'company-backends)
               '((company-shell company-eshell-history)))))

But in eshell-mode Company is also using company-dabbrev backend for the completion candidates, next to the backends company-shell and company-eshell-history.

So I'm wondering how I could 'tell' company do not use company-dabbrev backend when the buffer is in eshell-mode. I couldn't find any answer/solution on this.

  • What (buffer-local) value of company-backends do you see in an eshell-mode buffer? – Dmitry Feb 10 '16 at 20:46
  • C-h v company-backends in eshell-mode buffer gives me the following: pastebin.com/WwZqFCxs I find that weird, given the fact I see the results coming from company-shell and company-eshell-history but I don't see it back in the value of company-backends. – ReneFroger Feb 10 '16 at 20:55
  • Either way, there's some other code that modifies company-backends for you. Maybe you can ask someone (in a Spacemacs support channel?) how and why. In a vanilla Emacs, your solution should work. – Dmitry Feb 11 '16 at 0:53
  • @Dmitry May I ask why you assumed I could use Spacemacs? I maintain my own Spacemacs. – ReneFroger Feb 11 '16 at 8:44
  • The value of company-backends in your paste looks similar to how Spacemacs uses company-yasnippet. – Dmitry Feb 11 '16 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.