unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Eglot Failed to completion for commands defined in specified loaded packages for auctex.
@ 2021-06-16  3:37 Hongyi Zhao
  2021-06-16  4:59 ` Tassilo Horn
  0 siblings, 1 reply; 4+ messages in thread
From: Hongyi Zhao @ 2021-06-16  3:37 UTC (permalink / raw)
  To: help-gnu-emacs, auctex, auctex-devel

[-- Attachment #1: Type: text/plain, Size: 1887 bytes --]

On Ubuntu 20.04, I installed auctex, eglot, company, yasnippet into
Emacs through straight as shown below:

```emacs-lisp
(straight-use-package
 `( auctex :type git :host nil :repo
"https://git.savannah.gnu.org/git/auctex.git"
    :pre-build ,(pcase system-type
                (`berkeley-unix '("gmake"))
                (_ '(
                    ;("bash" "-c" "cd ~/.emacs.d/straight/repos/auctex")
                    ("./autogen.sh")
                    ("./configure" "--without-texmf-dir" "--with-lispdir=.")
                    ("make")
                    )))))
     (setq TeX-data-directory (straight--repos-dir "auctex")
           TeX-lisp-directory TeX-data-directory)

     (eval-after-load 'info
        '(add-to-list 'Info-additional-directory-list
                      (concat (straight--repos-dir "auctex") "doc")))

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)

(use-package company)
(add-hook 'after-init-hook 'global-company-mode)

(use-package yasnippet)
(require 'yasnippet)
(yas-reload-all)
(add-hook 'prog-mode-hook #'yas-minor-mode)

(use-package eglot)

(with-eval-after-load 'tex
  (define-key TeX-mode-map [remap TeX-complete-symbol] #'completion-at-point))
```

Then I open the following tex document in Emacs

```
\documentclass{paper}
\usepackage{braket}
\begin{document}
   Some testing comes here.
\end{document}
```

and enable Eglot (M-x eglot), but I find that Eglot Failed to do the
completion for commands defined in specified loaded packages for
auctex. But TeXstudio doesn't have this problem.

See the screenshots in attachments for more detailed info.

Regards,
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China

[-- Attachment #2: texstudio.png --]
[-- Type: image/png, Size: 74108 bytes --]

[-- Attachment #3: emacs.png --]
[-- Type: image/png, Size: 72470 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Eglot Failed to completion for commands defined in specified loaded packages for auctex.
  2021-06-16  3:37 Eglot Failed to completion for commands defined in specified loaded packages for auctex Hongyi Zhao
@ 2021-06-16  4:59 ` Tassilo Horn
  2021-06-16  9:00   ` Hongyi Zhao
  2021-06-21 11:54   ` Basil L. Contovounesios
  0 siblings, 2 replies; 4+ messages in thread
From: Tassilo Horn @ 2021-06-16  4:59 UTC (permalink / raw)
  To: Hongyi Zhao; +Cc: auctex-devel, help-gnu-emacs, auctex

[-- Attachment #1: Type: text/plain, Size: 710 bytes --]

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> Then I open the following tex document in Emacs
>
> ```
> \documentclass{paper}
> \usepackage{braket}
> \begin{document}
>    Some testing comes here.
> \end{document}
> ```
>
> and enable Eglot (M-x eglot), but I find that Eglot Failed to do the
> completion for commands defined in specified loaded packages for
> auctex. But TeXstudio doesn't have this problem.

Do you know what Eglot is?  It's an LSP (Language Server Protocol)
client which requests completions, documentation, etc. from an LSP
server.  I doubt there is a LaTeX LSP server.

You can use company-mode with capf (and dabbrev) backend with auctex to
get completion popups, see this screenshot:

[-- Attachment #2: Screenshot-2021-06-16_070214.png --]
[-- Type: image/png, Size: 13660 bytes --]

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]


That should work out of the box with no additional packages except for
company and then enabling `company-mode' in your LaTeX buffer.

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Eglot Failed to completion for commands defined in specified loaded packages for auctex.
  2021-06-16  4:59 ` Tassilo Horn
@ 2021-06-16  9:00   ` Hongyi Zhao
  2021-06-21 11:54   ` Basil L. Contovounesios
  1 sibling, 0 replies; 4+ messages in thread
From: Hongyi Zhao @ 2021-06-16  9:00 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: auctex-devel, help-gnu-emacs, auctex

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

On Wed, Jun 16, 2021 at 1:05 PM Tassilo Horn <tsdh@gnu.org> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > Then I open the following tex document in Emacs
> >
> > ```
> > \documentclass{paper}
> > \usepackage{braket}
> > \begin{document}
> >    Some testing comes here.
> > \end{document}
> > ```
> >
> > and enable Eglot (M-x eglot), but I find that Eglot Failed to do the
> > completion for commands defined in specified loaded packages for
> > auctex. But TeXstudio doesn't have this problem.
>
> Do you know what Eglot is?  It's an LSP (Language Server Protocol)
> client which requests completions, documentation, etc. from an LSP
> server.  I doubt there is a LaTeX LSP server.
>
> You can use company-mode with capf (and dabbrev) backend with auctex to
> get completion popups, see this screenshot:

I think I have installed them, as shown in the screenshot below.

>
> That should work out of the box with no additional packages except for
> company and then enabling `company-mode' in your LaTeX buffer.
>
> Bye,
> Tassilo



-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China

[-- Attachment #2: 2021-06-16_16-57.png --]
[-- Type: image/png, Size: 13296 bytes --]

[-- Attachment #3: 2021-06-16_17-00.png --]
[-- Type: image/png, Size: 25121 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Eglot Failed to completion for commands defined in specified loaded packages for auctex.
  2021-06-16  4:59 ` Tassilo Horn
  2021-06-16  9:00   ` Hongyi Zhao
@ 2021-06-21 11:54   ` Basil L. Contovounesios
  1 sibling, 0 replies; 4+ messages in thread
From: Basil L. Contovounesios @ 2021-06-21 11:54 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: auctex-devel, help-gnu-emacs, auctex

Tassilo Horn <tsdh@gnu.org> writes:

> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
>> Then I open the following tex document in Emacs
>>
>> ```
>> \documentclass{paper}
>> \usepackage{braket}
>> \begin{document}
>>    Some testing comes here.
>> \end{document}
>> ```
>>
>> and enable Eglot (M-x eglot), but I find that Eglot Failed to do the
>> completion for commands defined in specified loaded packages for
>> auctex. But TeXstudio doesn't have this problem.

I'm guessing that's because your LSP server isn't configured or able to
do that.

> Do you know what Eglot is?  It's an LSP (Language Server Protocol)
> client which requests completions, documentation, etc. from an LSP
> server.  I doubt there is a LaTeX LSP server.

I successfully use Eglot with Digestif[1].  I would try TexLab[2] that
Joost mentioned as well but it's not as easy for me to compile it given
the version of Rust on Debian.

[1]: https://github.com/astoff/digestif
[2]: https://github.com/latex-lsp/texlab

> You can use company-mode with capf (and dabbrev) backend with auctex to
> get completion popups, see this screenshot:
>
> That should work out of the box with no additional packages except for
> company and then enabling `company-mode' in your LaTeX buffer.

Eglot also works OOTB, except for one minor detail: I have to remap
AUCTeX's binding of TeX-complete-symbol back to the default
completion-at-point, which Eglot hooks into.

-- 
Basil



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-21 11:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-16  3:37 Eglot Failed to completion for commands defined in specified loaded packages for auctex Hongyi Zhao
2021-06-16  4:59 ` Tassilo Horn
2021-06-16  9:00   ` Hongyi Zhao
2021-06-21 11:54   ` Basil L. Contovounesios

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).