On Tue, May 2, 2023 at 1:30 PM Arash Esbati <ar...@gnu.org> wrote:
>
> Hongyi Zhao <hongyi.z...@gmail.com> writes:
>
> > My current configuration:
> >
> > (use-package company-math
> >   :hook
> >   ;; This will enable the company-math backend for LaTeX mode
> >   (LaTeX-mode . (lambda ()
> >           (setq-local company-backends
> >                   (append '((company-math-symbols-latex 
> > company-latex-commands))
> >                       company-backends))))
> >   )
> >
> > See the attached file for the results returned using your example.
>
> I think you need none of company-math-symbols-latex and
> company-latex-commands, AUCTeX offers already a Capf for both of them,
> so comment out that part and start company without any additions in your
> .tex file.
>
> > What's your corfu configuration?
>
> (setq tab-always-indent 'complete)
> (setq corfu-auto t)
> (global-corfu-mode)

Now, I've disabled all the company-mode related configuration and try
switching to corfu as follows:

;; https://github.com/minad/corfu#installation-and-configuration
(use-package corfu
  ;; Optional customizations
  ;; :custom
  ;; (corfu-cycle t)                ;; Enable cycling for `corfu-next/previous'
  (corfu-auto t)                 ;; Enable auto completion
  ;; (corfu-separator ?\s)          ;; Orderless field separator
  ;; (corfu-quit-at-boundary nil)   ;; Never quit at completion boundary
  ;; (corfu-quit-no-match nil)      ;; Never quit, even if there is no match
  ;; (corfu-preview-current nil)    ;; Disable current candidate preview
  ;; (corfu-preselect 'prompt)      ;; Preselect the prompt
  ;; (corfu-on-exact-match nil)     ;; Configure handling of exact matches
  ;; (corfu-scroll-margin 5)        ;; Use scroll margin

  ;; Enable Corfu only for certain modes.
  ;; :hook ((prog-mode . corfu-mode)
  ;;        (shell-mode . corfu-mode)
  ;;        (eshell-mode . corfu-mode))

  ;; Recommended: Enable Corfu globally.
  ;; This is recommended since Dabbrev can be used globally (M-/).
  ;; See also `corfu-exclude-modes'.
  :init
  (global-corfu-mode))

;; A few more useful configurations...
(use-package emacs
  :init
  ;; TAB cycle if there are only few candidates
  (setq completion-cycle-threshold 3)

  ;; Emacs 28: Hide commands in M-x which do not apply to the current mode.
  ;; Corfu commands are hidden, since they are not supposed to be used via M-x.
  ;; (setq read-extended-command-predicate
  ;;       #'command-completion-default-include-p)

  ;; Enable indentation+completion using the TAB key.
  ;; `completion-at-point' is often bound to M-TAB.
  (setq tab-always-indent 'complete))


But I cannot get any completion effect provided by corfu, as shown in
the attached screenshot.

> Best, Arash

Regards, Zhao

Reply via email to