a-concerned-mother · 2022-10-15 16:05
[deleted] · 2022-10-15 22:18
[deleted]
JDRiverRun · 2022-10-16 02:43
In fact you *could* use the core of company solely with completion at point functions, supplementing/compositing those with cape. Then it would function mostly as a well-tuned UI for native completion. On the other hand, cape allows you to transubstantiate company backends into completion at point functions, so it's possible to make corfu and cape behave pretty similarly.
One issue I notice with company actually appears in this video during its brief demo at 9min: in buffers with variable-width or hidden/prettified symbols (like org and many others often are), the overlay method has off-by-one layout issues. Corfu uses child frames so doesn't suffer from this. This also means in-buffer pop-up completion can be used *in the minibuffer,* which is nice. And the ability to use orderless in buffer is quite good for those who are used to it.
holgerschurig · 2022-10-16 16:22
He mentioned dabbrev and hippie, but not pcomplete. Any reason, is it outdated, obsolete?
(I mean I am using cape+corfu since sone months,so I don't really need it ... or?)
a-concerned-mother · 2022-10-16 19:28
I guess I didn't consider it code completion but it probably would have been worth mentioning. Maybe I'll cover it in a future video. Thanks for pointing that out :)
a-concerned-mother · 2022-10-16 19:41
I didn't intend to discredit the company project. Its done a lot of good and still has features that corfu doesnt with the in buffer completion (rather than a popup when there is only one completion) however this was just what I preferred. I also chose not to talk about all the possible minibuffer completion interfaces since I knew that would make this video way too long. Which is why I only gave it brief mention.
As far as what I mean by native completion is that with corfu pretty much everything I set for my minibuffer completion is what I want to have and having a completely custom alternative like company means that many of the completion facilities in Emacs need extra work to be applied to company. All it takes is justa quick look at the code bases for both products to understand what I mean by using native features
Company is about 8000 lines of code while Corfu is only 1300. Not that LOC is everything but I think it gives a good idea of just how much additional work has to be done by company.
[deleted] · 2022-10-16 21:37
[deleted]
a-concerned-mother · 2022-10-16 23:10
I didn't include the make file no. This isn't even including comments. I used [https://github.com/blackducksoftware/ohcount](https://github.com/blackducksoftware/ohcount) to only count the lines of code. You make a good point. Only fair if I include cape just to give company a better shot.
Cape is 1085 lines of code so if we add those together we get 2385 loc which is still a lot better than 8000.
[deleted] · 2022-10-17 06:15
[deleted]
hvis · 2022-10-17 13:38
> Corfu uses child frames so doesn't suffer from this
There are a couple of third-party frontends for company that use child frames. So you could enjoy the same benefits with it.
Aside from the minibuffer -- that would need a little work.
a-concerned-mother · 2022-10-17 17:11
None of the company backends are used by cape. Pretty much all of the built in company backends. Cape+Corfu is all you would need. There isn't a dependency on company unless you want to use a company specific backend which I don't actually use and don't really know of anyone using that. If you remove the backends from company then I don't think it makes sense to include cape since at that point company would have even less functionality than Corfu.
If you install cape and Corfu yourself you will see that it isn't going to be installed as a dependency
[deleted] · 2022-10-17 18:09
[deleted]
FreeAd7233 · 2022-10-19 09:06
My experience with company and corfu (also corfu-terminal) js that, company is significantly less performant than corfu.
However, as I understand, corfu solely relies on completion-at-point-functions, which is a quiet ancient interface and synchronous, and company can support asynchronous backend, for example (company-anaconda, a Python completion backend which does not support capf because it is asynchronous).
So I am simply just curious that, why does an async completion framework perform less performant than a simple completion ui that relies solely on synchronous backends?
Plus: the biggest advantage (or historical heritage) of company is: company-Yasnippet which due to some mechanism cannot be ported capf by cape. So you cannot auto complete snippets with corfu…..And I think this is pretty much a deal breaker to me. I just plan to move my yasnippets to tempel for this reason…
a-concerned-mother · 2022-10-19 13:42
I'd still say it's more than 2x and as far as I know doesn't support integration with orderless unless you are using exclusively completion at point which means you need to port all your company backends to completion at point functions meaning it would also need cape to match support all the use cases Corfu would. I'm also not sure if you can even use company's completion at point without the capf backend. So 2x the code and supports some usecases Corfu doesn't but also lacks in multiple use cases and company would have no backends at all.