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) "-"))))
|
(mapconcat #'identity (mapcar #'symbol-name modes) "-"))))
|
||||||
(quoted (eq (car-safe backends) 'quote)))
|
(quoted (eq (car-safe backends) 'quote)))
|
||||||
;; TODO more type checks
|
;; TODO more type checks
|
||||||
`(progn
|
`(prog1
|
||||||
(defun ,def-name ()
|
(defun ,def-name ()
|
||||||
|
(when (memq major-mode ',modes)
|
||||||
(require 'company)
|
(require 'company)
|
||||||
(setq-local company-backends (append '((,@backends)) company-backends)))
|
(unless (member ',backends company-backends)
|
||||||
|
(setq-local company-backends (append '((,@backends)) company-backends)))))
|
||||||
(add-hook! ,modes #',def-name))))
|
(add-hook! ,modes #',def-name))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue