0

I am unable to get autocompletion with corfu when I enable eglot-grammarly. Here is a MWE.

(setq straight-build-dir (format "build/%d%s%d"
                                 emacs-major-version
                                 version-separator
                                 emacs-minor-version)
      straight-use-package-by-default t)

(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 6))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(setq use-package-hook-name-suffix nil)
(straight-use-package 'use-package)

(use-package corfu
  :custom
  (corfu-auto t "Enable auto completion")
  :config
  (global-corfu-mode 1))

(use-package cape
  :after corfu
  :config
  (add-hook
    'text-mode-hook
    (lambda ()
      (remove-hook 'completion-at-point-functions #'eglot-completion-at-point t)
      (setq-local completion-at-point-functions
        (list #'cape-file #'cape-dabbrev #'cape-dict)))))

(use-package eglot-grammarly
  :straight (:host github :repo "emacs-grammarly/eglot-grammarly")
  :hook
  (text-mode-hook . (lambda ()
      (require 'eglot-grammarly)
      (eglot-ensure))))

The value of completion-at-point-functions for a text file is as follows.

Its value is
(eglot-completion-at-point cape-file cape-dabbrev cape-dict)
Local in buffer email.txt; global value is
(tags-completion-at-point-function)

Please suggest what is wrong in the setup. Thanks.

Swarnendu Biswas
  • 1,378
  • 1
  • 11
  • 24

0 Answers0