Fix company-auctex not initializing properly in Auctex buffers #326

Caused because AucTex's LaTeX-mode reports its major-mode as
'latex-mode. A check in :company-backends expects major modes to have
matching hooks (e.g. LaTeX-mode-hook => LaTeX-mode).
This commit is contained in:
Henrik Lissner 2018-01-04 13:26:37 -05:00
parent 88f8c27a7d
commit feff92c626
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -40,7 +40,12 @@
(def-package! company-auctex
:when (featurep! :completion company)
:init
(set! :company-backend 'LaTeX-mode '(company-auctex))))
;; We can't use the (set! :company-backend ...) because Auctex reports its
;; major-mode as `latex-mode', but uses LaTeX-mode-hook for its mode, which
;; is :company-backend doesn't anticipate (and shouldn't have to!)
(add-hook! LaTeX-mode
(make-variable-buffer-local 'company-backends)
(company-auctex-init))))
(def-package! reftex ; built-in