From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.devel Subject: Re: What is the most useful potential feature which Emacs lacks? A: Autocompletion Date: Wed, 03 Jun 2020 16:59:59 +0300 Message-ID: References: <380db8f0-0e18-744f-d72a-a6e12c3b6e1d@yandex.ru> <8919f9382c738573f20d97e22f293d61866f99b8.camel@yandex.ru> <5f3891ac-29f5-f544-360c-384ff9608bd1@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="90451"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.36.3 To: Dmitry Gutov , ndame , Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 03 16:00:58 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jgTww-000NQG-Ui for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Jun 2020 16:00:58 +0200 Original-Received: from localhost ([::1]:40814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgTwv-0000N3-D7 for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Jun 2020 10:00:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgTw7-0008H2-84 for emacs-devel@gnu.org; Wed, 03 Jun 2020 10:00:07 -0400 Original-Received: from forward104j.mail.yandex.net ([5.45.198.247]:44016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgTw4-0004xR-IB for emacs-devel@gnu.org; Wed, 03 Jun 2020 10:00:06 -0400 Original-Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 8D04E4A022C; Wed, 3 Jun 2020 17:00:00 +0300 (MSK) Original-Received: from sas1-e00c2743cdb8.qloud-c.yandex.net (sas1-e00c2743cdb8.qloud-c.yandex.net [2a02:6b8:c14:3a22:0:640:e00c:2743]) by mxback7o.mail.yandex.net (mxback/Yandex) with ESMTP id lET7KIQvby-00leg3Ri; Wed, 03 Jun 2020 17:00:00 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1591192800; bh=B22Dc4qeHaCV6WCgCVCVIRR+/hZs0d6liVNTtnzJKlk=; h=In-Reply-To:To:From:Subject:Message-ID:References:Date; b=Z9baPBIWXpUhs1UnTgpGx5vTPgaU+SQhnRjq35ymG5pCZYPW0kemBuU7lrZSp9UIo uOJ1Fv4HrbY1eJC+pB8s4KSwqg/S889d5xoXE3YdLUhpsZTwElZXy2QxG/dLbXv7Cw Vm4qtr+WTKM+c7/ELGRT7VzsYTAYaQaUL+wMLGb0= Authentication-Results: mxback7o.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by sas1-e00c2743cdb8.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id cA2LLi3sDQ-xxa83cF7; Wed, 03 Jun 2020 17:00:00 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) In-Reply-To: <5f3891ac-29f5-f544-360c-384ff9608bd1@yandex.ru> Received-SPF: pass client-ip=5.45.198.247; envelope-from=hi-angel@yandex.ru; helo=forward104j.mail.yandex.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/03 10:00:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251805 Archived-At: 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 autocompletion. > > > 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 irony-server)` 4. I tried typing a gibberish to see if I get any delay in rendering a text. 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?