On Mon, May 1, 2023 at 8:47 PM Hongyi Zhao <hongyi.z...@gmail.com> wrote:
>
> On Mon, May 1, 2023 at 6:20 PM Arash Esbati <ar...@gnu.org> wrote:
> >
> > Hongyi Zhao <hongyi.z...@gmail.com> writes:
> >
> > > Some time ago, it seemed that my auctex configuration was able to
> > > provide autocomplete for LaTeX commands and packages names. However,
> > > currently, all of these functions are disabled. How should I enable
> > > these features again?
> >
> > Maybe you've changed to value of `TeX-arg-input-file-search'?
> >
> > ,----[ C-h v TeX-arg-input-file-search RET ]
> > | TeX-arg-input-file-search is a variable defined in ‘latex.el’.
> > |
> > | Its value is t
> > |
> > | If ‘TeX-arg-input-file’ should search for files.
> > | If the value is t, files in TeX’s search path are searched for
> > | and provided for completion.  The file name is then inserted
> > | without directory and extension.  If the value is nil, the file
> > | name can be specified manually and is inserted with a path
> > | relative to the directory of the current buffer’s file and with
> > | extension.  If the value is ‘ask’, you are asked for the method
> > | to use every time ‘TeX-arg-input-file’ is called.
> > |
> > |   You can customize this variable.
> > |
> > `----
>
> I've the exactly same setting as yours. See the attached screenshot
> for the real completion results in my currently case.
>
> It seems that the problem is caused by an incorrect company-backends
> configurations, so I further checked by `C-h v company-backends RET`
> and got the following value:
>
> Value: (company-fuzzy-all-other-backends)
> Original value was
> (company-bbdb company-semantic company-cmake company-capf
> company-clang company-files
>           (company-dabbrev-code company-gtags company-etags company-keywords)
>           company-oddmuse company-dabbrev)
> Local in buffer test.tex; global value is
> (company-math-symbols-unicode company-native-complete company-bbdb
> company-semantic company-cmake company-capf company-clang
> company-files
>                   (company-dabbrev-code company-gtags company-etags
> company-keywords)
>                   company-oddmuse company-dabbrev)

I commented out the `company-fuzzy` and `company-math` packages, now it works.

But I really want to have the feature provided by `company-math`, and
it seems that my following configuration seems to be both chaotic and
problematic:

(use-package company-math
  :hook
  (LaTeX-mode . (lambda ()
          (setq-local company-backends (append '(company-math-symbols-latex
                             company-latex-commands)
                               (company--backends)
                               ))))

  :config
  (add-to-list 'company-backends 'company-math-symbols-unicode)
  ;; https://github.com/company-mode/company-mode/discussions/1253
  ;; (set-company-backend 'LaTeX-mode
  ;;   'company-math-symbols-latex 'company-latex-commands
'company-math-symbols-unicode)
  )

If anyone has experience about how to configure and use this package
better, I will be very grateful.

Regards,
Zhao

Reply via email to