bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51819: The Senselessness of Emacs Company Mode


From: Carlos Pita
Subject: bug#51819: The Senselessness of Emacs Company Mode
Date: Wed, 17 Nov 2021 00:08:44 -0300

> It is the mini-buffer thing.  It is not so easy to go through and make the 
> selections though.

I agree. But you have a number of options here:

1. Use company.
2. Use corfu.
3. Use ivy completion-at-point.
4. Use a completing-read framework able to channel buffer completion
to the minibuffer. Selectrum is one, and consult allows you to do that
with any completing-read framework. See [1] and [2].

All but the first one are 100% compatible with completion-at-point.
Company adds some nifty extensions on top of that but if you use the
company-capf backend (this is automatic) it's compatible with all
completion-at-point functions.

> I am very interested in completion of words as I write documents.

For a very straightforward 80/20 solution take a look at dabbrev. That
said, there is an ispell backend for company but, sadly, no ispell
completion-at-point function. This is perhaps a downside of
extensions: even though it's easy to implement this function, effort
has been put into implementing one variant that's only compatible with
company (which AFAICS doesn't depend on any additional feature of
company). Fortunately, the author of corfu is about to publish a very
small library implementing some missing functions from which all
completion-at-point compatible implementations will benefit, see [3].
There you have combined word/spell/dabbrev completion functions that
help enter text. Functions like these may eventually find their way
into emacs.

> what is the best completion there is that is immediately available
> after installing emacs.  I recommend a completion implementation that is 
> available
> automatically by default, but which uses a popup window as provided by either
> auto-complete or company-mode as a start.

There is nothing off-the-shelf that fulfills these requirements. In theory
there is icomplete-in-buffer but in practice the implementation is
buggy (see #51575). Given that you want on-the-fly completions,
options 1 and 2 above are the way to go. You can stick with company,
which is a good battle-tested option and nowadays works mostly through
the company-capf backend, so it channels standard completion-at-point
functions, although you can still take advantage of specific
extensions like the aforementioned company-ispell. Or you can try
corfu which is a simple frontend to completion-at-point, and set
corfu-auto in order to enable on-the-fly completions; in this case,
take into account [3]. Both solutions easily address your immediate
needs, the second one also addresses your more general and harsh
complaint here, but it's still somewhat WIP (although the code is high
quality and the minimalistic nature of the solution makes it
relatively bug free).

Best regards,
Carlos

---

[1] consult-completion-in-region in
https://github.com/minad/consult#miscellaneous.
[2] https://github.com/raxod502/selectrum/issues/42
[3] https://github.com/minad/corfu/issues/9#issuecomment-945090516





reply via email to

[Prev in Thread] Current Thread [Next in Thread]