Don't let derived modes inherit company backends
This commit is contained in:
parent
82efbbd3fb
commit
99bf1c04fb
1 changed files with 6 additions and 4 deletions
|
@ -8,10 +8,12 @@
|
|||
(mapconcat #'identity (mapcar #'symbol-name modes) "-"))))
|
||||
(quoted (eq (car-safe backends) 'quote)))
|
||||
;; TODO more type checks
|
||||
`(progn
|
||||
(defun ,def-name ()
|
||||
(require 'company)
|
||||
(setq-local company-backends (append '((,@backends)) company-backends)))
|
||||
`(prog1
|
||||
(defun ,def-name ()
|
||||
(when (memq major-mode ',modes)
|
||||
(require 'company)
|
||||
(unless (member ',backends company-backends)
|
||||
(setq-local company-backends (append '((,@backends)) company-backends)))))
|
||||
(add-hook! ,modes #',def-name))))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue