all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alexander Adolf <alexander.adolf@condition-alpha.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: Eshel Yaron <me@eshelyaron.com>, Juri Linkov <juri@linkov.net>,
	Eli Zaretskii <eliz@gnu.org>,
	emacs-devel@gnu.org
Subject: Re: Inline completion preview
Date: Mon, 30 Oct 2023 13:42:51 +0100	[thread overview]
Message-ID: <b944e43d3beee25a28cdda7878c0e386@condition-alpha.com> (raw)
In-Reply-To: <CALDnm53ct=6U3DXJ67jF08TwyjMEPjru94Hn0mHj32ViCzfzbw@mail.gmail.com>

João Távora <joaotavora@gmail.com> writes:

> On Sun, Oct 29, 2023 at 4:25 PM Alexander Adolf
> <alexander.adolf@condition-alpha.com> wrote:
>>
>> Company provides an ecosystem of its own, and that can make one’s setup more complicated.
>
> I agree it provides more abstractions then are essential, but you don't
> have to use them.  Eglot-managed buffers prefer the company-capf backend
> by default and it works fine just fine.
>
> So the "complicated setup" you're looking for might just be one line:
>
>    (setq company-backends '(company-capf))

Indeed. But the complexity I was intending to refer to came with
integrating company with other 3rd party packages. Because of comapny's
age (it predates some of Emacs's current completion infrastructure),
many 3rd party packages have specific company adaptation code. As
packages and Emacs evolve, an adaptation or two tend to break with each
update. This kept my company config growing and growing.

My corfu config is still as small as it was on day one.

>> I have moved to corfu, which fully builds on Emacs’s ecosystem, and
>> have never looked back.
>
> company-capf is perfectly compatible with Emacs's completion functions
> as well.

It does. But in such a configuration you're only using a rather small
subset of company's code. What's the point of having such a big codebase
then? Lot sof unneeded complexity, IMHO.

> Corfu has known problems with Eglot, for example.

And it used to have with LSP. To my experience, in 99% of the cases the
problem and the fix lies with the other package, which was not using
Emacs's completion system properly (as was for instance teh case with
LSP).

> As far I understand, the way to fix them (presumably) is based on an
> additional thing called "cape" which works by monkey patching Eglot's
> functions via advice, which I don't think is really elegant.

Cape can wrap completion code, which is not compliant with Emacs's
completion framework, into wrapper functions which make it compliant
with the interfaces Emacs provides for, and expects from completion
functions. Thus, cape is a migration aid. You can switch from whatever
you used before to corfu, and keep using all your legacy completion
sources. This buys you time to find other completion sources which are
good `completion-at-point` citizens to replace your legacy ones.

> Also company works on TTY Emacs out of the box, and I think Corfu
> doesn't.  More stuff to add in.

Corfu works with TTY Emacs of of the box, too.

Under a graphical environment, corfu uses a frame provided by the
graphical environment (for instance the window manager) to display the
candidates. That way the display of the "popover" is independent of the
fonts used in the buffer. Consider as an example an Org buffer, where
the headings are rendered in a bigger font. Company will render popvover
text in that area using the bigger font.

Result with company:
----------------------------------------------------------------------

       The quick brown fox jum
                              +-------------+
                              | candidate 1 |
       * BIG FONT HEADING      | CANDIDATE 2    |
         BIG FONT HEADING      | CANDIDATE 2    |
                              | candidate 3 |
                              | candidate 4 |
                              +-------------+
----------------------------------------------------------------------

Duh! Company certainly showing its age here.


Result with corfu:
----------------------------------------------------------------------

       The quick brown fox jum
                              +-------------+
                              | candidate 1 |
       * BIG FONT HEADING     | candidate 2 |
         BIG FONT HEADING     | candidate 3 |               
                              | candidate 4 |
                              +-------------+
----------------------------------------------------------------------

> So, as I see it, with Company you get hassle free completion by
> customizing a way a bit of its functionality, whereas with Corfu you
> have to add stuff to your .emacs.  As I see it, it's really Corfu
> that has the most complicated setup.

My experience is the exact opposite.

As mentioned, I used company for many years. I kept compiling
complexities over complexities, and hacks for this and that in my
dot-emacs.

Making the switch to corfu was like a liberation. Tiny config, zero
hassle ever since.

Just my two cents anyway.

  --alexander




  parent reply	other threads:[~2023-10-30 12:42 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-26 18:11 Inline completion preview Eshel Yaron
2023-10-26 18:38 ` Eli Zaretskii
2023-10-26 19:39   ` Eshel Yaron
2023-10-27  5:52     ` Eli Zaretskii
2023-10-27 15:43       ` Eshel Yaron
2023-10-27 17:12         ` Eli Zaretskii
2023-10-27 18:13           ` Eshel Yaron
2023-10-27 20:25             ` chad
2023-10-28 16:47         ` Juri Linkov
2023-10-28 19:01           ` Eshel Yaron
2023-10-29 16:24             ` Alexander Adolf
2023-10-29 23:29               ` João Távora
2023-10-30  9:25                 ` Juergen Fenn
2023-10-30  9:36                   ` João Távora
2023-10-30 11:04                     ` Dmitry Gutov
2023-10-30 12:42                 ` Alexander Adolf [this message]
2023-10-30 13:01                   ` João Távora
2023-10-30 17:32                     ` Alexander Adolf
2023-10-30 17:52                       ` João Távora
2023-10-30 13:20                   ` Dmitry Gutov
2023-10-30 17:43                     ` Alexander Adolf
2023-10-30 22:49                       ` Dmitry Gutov
2023-10-31  6:50                         ` Eshel Yaron
2023-10-31 17:31                           ` Alexander Adolf
2023-10-31 17:43                             ` Eshel Yaron
2023-10-31 23:29                           ` Dmitry Gutov
2023-11-01  8:30                             ` Eshel Yaron
2023-11-01 10:11                               ` João Távora
2023-11-01 10:44                                 ` Eshel Yaron
2023-11-01 11:07                                   ` João Távora
2023-11-01 12:17                                     ` Eshel Yaron
2023-11-01 12:23                                     ` Dmitry Gutov
2023-11-01 14:07                                       ` Juergen Fenn
2023-11-01 19:57                                         ` Dmitry Gutov
2023-11-01 12:08                                   ` Dmitry Gutov
2023-11-01 12:14                               ` Dmitry Gutov
2023-11-01 12:24                                 ` Dmitry Gutov
2023-11-01 12:29                                 ` Eshel Yaron
2023-11-01 12:32                                   ` Dmitry Gutov
2023-11-01 12:34                                 ` Eli Zaretskii
2023-11-01 12:36                                   ` Dmitry Gutov
2023-11-01 13:28                         ` Po Lu
2023-11-01 19:49                           ` Dmitry Gutov
2023-10-27  8:58     ` Ihor Radchenko
2023-10-27 15:53       ` Eshel Yaron
2023-10-27 11:49   ` João Távora
2023-10-27 11:52     ` João Távora
2023-10-27 12:18     ` Eli Zaretskii
2023-10-27 12:55       ` João Távora
2023-10-27 12:58         ` Eli Zaretskii
2023-10-27 13:05     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b944e43d3beee25a28cdda7878c0e386@condition-alpha.com \
    --to=alexander.adolf@condition-alpha.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=juri@linkov.net \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.