summaryrefslogtreecommitdiff
path: root/cape.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2024-06-19 19:00:54 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2024-06-19 19:02:17 +0200
commitf61da109a9e4491614938c300291060fd8855c1b (patch)
treee11c07c7d27810cb16f7bda1762d4ee4ee9299ae /cape.el
parenta71e5c96564163837810b96bd34322b42f6e4d9c (diff)
`cape-company-to-capf` should not be used if `company-mode` is enabled
Instead the Company backends should be used directly, to avoid the unnecessary indirection and potential performance and compatibility issues due to the double conversion Company -> Capf -> Company.
Diffstat (limited to 'cape.el')
-rw-r--r--cape.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/cape.el b/cape.el
index b5f6c5d..adab1f1 100644
--- a/cape.el
+++ b/cape.el
@@ -824,6 +824,8 @@ changed. The function `cape-company-to-capf' is experimental."
(lambda ()
(when (and (symbolp backend) (not (fboundp backend)))
(ignore-errors (require backend nil t)))
+ (when (bound-and-true-p company-mode)
+ (error "`cape-company-to-capf' should not be used with `company-mode', use the Company backend directly instead"))
(when (and (symbolp backend) (not (alist-get backend cape--company-init)))
(funcall backend 'init)
(put backend 'company-init t)