latex mode unexpected company backend behaviour
- Dominant language
- Emacs Lisp
- Stars
- 22.7k
- Forks
- 3.1k
- Avg merge
- 10h 46m
- Merged PRs (30d)
- 4
Description
**What did you expect to happen?**
``` emacs-lisp
(after! latex
(set-company-backend! 'latex-mode '(company-cdlatex-backend ...)))
```
should set the custom backend list as the **first** backend in latex mode.
**What actually happened?**
Actually it has the reftex backends at the beginning of the list.
Some searching yields that the line
``` emacs-lisp
(set-company-backend! 'reftex-mode 'company-reftex-labels 'company-reftex-citations)
```
is loaded after the after! latex-block and seemingly also changes the latex-mode backends.
**workaround**
``` emacs-lisp
(after! reftex-mode ;; hopefully this fixes the company backend order...
(set-company-backend! 'reftex-mode nil)
(set-company-backend! 'latex-mode
'(company-cdlatex-backend ...)
;; load the reftex-mode backends after my personal backends
'company-reftex-labels 'company-reftex-citations
))
```
**Additional details:**
- My private config resides here: https://cloud.tissot.de/gitea/benneti/dotfiles under .config/doom
- No warnings or errors associated with this issue
- Possible fixes, document the workaround in the latex README or change when and how the reftex-backends are inserted
- I am happy to fix it myself after you tell me what you would prefer and create a PR
**Steps to reproduce:**
1. enable :lang latex and :completion company
2. try to set a custom company backend
3. realize that reftex still preceeds the list
**System information:**
```
SYSTEM type gnu/linux
config x86_64-pc-linux-gnu
shell /usr/bin/fish
uname Linux 5.9.1-arch1-1 #1 SMP PREEMPT Sat, 17 Oct 2020 13:30:37 +0000 x86_64
path (~/.config/emacs/bin/ ~/.config/emacs/bin ~/.emacs.d/bin ~/go/bin ~/.local/bin ~/.config/emacs/bin ~/.emacs.d/bin ~/go/bin ~/.local/bin /usr/local/bin /usr/local/sbin /usr/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /usr/lib/jvm/default/bin /usr/lib/jvm/default/bin /usr/lib/emacs/27.1/x86_64-pc-linux-gnu/)
EMACS dir ~/.config/emacs/
version 27.1
build Aug 28, 2020
buildopts --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-wide-int --with-modules --with-cairo --with-harfbuzz 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
features XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
traits (server-running envvar-file)
DOOM dir ~/Repos/dotfiles/.config/doom/
version 2.0.9
build HEAD -> develop 9929883bf 2020-10-19 01:25:47 -0400
elc-files 0
modules (:completion company (ivy +icons) :ui doom doom-dashboard doom-quit hl-todo modeline neotree ophints (popup +defaults) unicode vc-gutter vi-tilde-fringe (window-select +numbers +switch-window) :editor (evil +everywhere) file-templates fold rotate-text snippets word-wrap :emacs (dired +ranger +icons) electric (ibuffer +icons) undo vc :term vterm :checkers syntax spell grammar :tools editorconfig (eval +overlay) lookup lsp magit pdf biblio :lang (cc +lsp) data emacs-lisp (julia +lsp) (latex +latexmk +cdlatex +lsp +fold) markdown (org +jupyter +dragndrop +pandoc +pretty +roam +ref) (python +lsp +cython) (sh +fish +lsp) :config (default +bindings +smartparens))
packages ((lsp-julia :recipe (:host github :repo non-jedi/lsp-julia)) (company-statistics) (company-quickhelp) (org-ref))
unpin (n/a)
elpa (n/a)
```
EDIT:
Also is there a simple way not to prepend company-capf to the list in latex mode even when using lsp, right now I change the lsp-completion-mode-hook completely which does not feel to elegant?
Contributor guide
Assessment
This issue has not been assessed yet.