fix(coq): corfu integration w/ company-coq

Close: #8491
Co-authored-by: qcfu-bu <qcfu-bu@users.noreply.github.com>
This commit is contained in:
Henrik Lissner
2025-09-11 23:28:24 -04:00
parent 6fcdb49225
commit 05137e14a5

View File

@@ -77,18 +77,15 @@
:references #'company-coq-grep-symbol :references #'company-coq-grep-symbol
:documentation #'company-coq-doc) :documentation #'company-coq-doc)
(setq company-coq-disabled-features '(hello company-defaults spinner)) (setq company-coq-disabled-features '(hello company company-defaults spinner))
(cond ((modulep! :completion corfu) (cond ((modulep! :completion corfu)
;; HACK: company-coq activates `company-mode', though it's not really ;; HACK: company-coq activates `company-mode', though it's not really
;; needed when we're relying on Corfu, hence these hacks: ;; needed when we're relying on Corfu, hence these hacks:
(add-hook! 'coq-mode-local-vars-hook (add-hook! 'coq-mode-local-vars-hook
(defun +coq-init-capf-completion-h () (defun +coq-init-capf-completion-h ()
(when (bound-and-true-p company-mode) (dolist (b '(company-coq-master-backend company-coq-math-symbols-backend))
(company-mode -1)) (add-to-list 'completion-at-point-functions (cape-company-to-capf b)))))
(add-hook 'completion-at-point-functions
(cape-company-to-capf 'company-coq-master-backend)
nil t)))
(defadvice! +coq--proof-goto-point-advice (&rest _) (defadvice! +coq--proof-goto-point-advice (&rest _)
:override #'company-coq--proof-goto-point-advice :override #'company-coq--proof-goto-point-advice
(when (bound-and-true-p company-candidates) (when (bound-and-true-p company-candidates)