[Top][All Lists]

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

Re: What is the most useful potential feature which Emacs lacks? A: Auto

From: Konstantin Kharlamov
Subject: Re: What is the most useful potential feature which Emacs lacks? A: Autocompletion
Date: Wed, 03 Jun 2020 16:59:59 +0300
User-agent: Evolution 3.36.3

On Wed, 2020-06-03 at 16:10 +0300, Dmitry Gutov wrote:
> On 03.06.2020 15:50, Konstantin Kharlamov wrote:
> > On Wed, 2020-06-03 at 15:36 +0300, Dmitry Gutov wrote:
> > > On 03.06.2020 14:39, Konstantin Kharlamov wrote:
> > > > Lack of such simple but immensely useful feature is so
> > > > disappointing
> > > > that some years ago I was trying to migrate over to some other
> > > > editor.
> > >
> > > What simple feature? Prediction? Is that like mind reading?
> >
> > You misunderstand what I say. In technical terms "prediction" here
> > means "the timeout set to 0".
> Timeout set to 0 means firing completion requests right after every
> user
> input. If completion is synchronous, that will of course lead to a
> slowdown (depending on how slow the backend is).
> For asynchronous ones, it could be fine, if the backing process can
> handle requests at such frequency.
> In general, the value of 0 seems wasteful to me, but it should work.

I am not sure why you say it seems wasteful. Do you mean perhaps, as
opposed to setting, say, 100ms? 100ms I think is the top limit this
timeout should be set. I just tested how quickly I can type a string
"prog". I fired up `libinput debug-events` and tried to type
"prog". The letter "g" says "+0.256s", i.e. it took 256ms. This means
even if I set to 100ms, there's high chance I won't get any

> > > As far a multithreading goes, try some backend that uses an
> > > external
> > > program (either of the LSP clients, or irony, rtags, etc). That's
> > > a
> > > basic kind of concurrency already available in Emacs.
> >
> > Just to make sure: and it not gonna lag if I set timeout to 0? If
> > yes,
> > then great to know, maybe I fell behind recent developments, I
> > should
> > try it then.
> To be 100% sure, you should try it yourself (I don't do C/C++).
> Maybe
> someone else here can testify, though.

Thank you! Indeed, I confirm this does seem to work with an async
backend. I tested it as follows:

1. Opened a test.cpp file, enabled company-irony, checked that
   completion works.
2. I set `(setq company-idle-delay 0)`
3. I paused the irony-server process with `kill -SIGSTOP $(pidof
4. I tried typing a gibberish to see if I get any delay in rendering a

I don't see any lags, so I assume using an async backend with the
timeout set to 0 should work fine. This is great news! I wonder if
company mode should default to zero or so timeout, and print a warning
if somebody tries to connect a non-async backend?

reply via email to

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