From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: What is the most useful potential feature which Emacs lacks? A: Autocompletion Date: Wed, 3 Jun 2020 17:21:44 +0300 Message-ID: <701b151d-2133-7916-3169-5d0f29cf3bb8@yandex.ru> 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; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="56438"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 To: Konstantin Kharlamov , ndame , Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 03 16:22:26 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 1jgUHi-000EYj-Kq for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Jun 2020 16:22:26 +0200 Original-Received: from localhost ([::1]:42382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgUHh-0006fc-MZ for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Jun 2020 10:22:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgUH8-0005V1-2F for emacs-devel@gnu.org; Wed, 03 Jun 2020 10:21:50 -0400 Original-Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:35501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgUH6-0001nV-R7 for emacs-devel@gnu.org; Wed, 03 Jun 2020 10:21:49 -0400 Original-Received: by mail-wm1-x343.google.com with SMTP id q25so2290435wmj.0 for ; Wed, 03 Jun 2020 07:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hSXKiUA1Ezm36zBo5QMD5ZIp1cjQdHmdn/YeGG9ov+4=; b=CQ+E9utwwfETqlgzw7nNfxPfeXx2INl+31yRQdlSB7xU13PT2vvDaaG1pFb8LqEjjT mWXn9A7xuW79b5YlV6+iWI8dDk6iieoaaBCS80TkCZq+nAhdOTpRWEeCpdhelm0TlEIz UWmKbwLHZCCOru8KrVCYojr4QEXxnznkbLhLgt3lJBBw/HP8024Hx2U+KOdTyZj8BWLp j+3CDSVsUigDj/WuioLjpUOX5wsj4NlXhx2lfQn1ABMI23LT0nfLQE+O5Y3SSDWVoEUJ XdSw/l+vcQ+fRCzPgmKMYAMKlzN0q65HivpnWZojTCMPuaBJyqZrP/pHeJdtV59PAUt6 bLmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hSXKiUA1Ezm36zBo5QMD5ZIp1cjQdHmdn/YeGG9ov+4=; b=EKJ/y8QqcqqRT8oJSsdeNws4SO9bJpZGr2FGXUJEI4pKA9dSoxgijYEqtwqLiTfQdH qlWhx/cWXbzBOko0im5uDhhHQwiFkuv6hWqOvtaOfvJoIPfjyrzsruwZ5sTa8Jc1G7P9 eX4JQkQZl7XTZ9zXLqsAfNLf0gfSUTqMmEwFGnpykbgA8382YYFIf78IyOQOS+/WImYS 4Sa/iFanu2X78ZllkOXrpkJ0h6c8A1+wEeEieALIi/Ese+HRZo4yxiIy6cZgU0wcrQkp dEQDnNVSstS61vw2l8NPQTSmZcCbYS+AVhV4krByLF0sMHjulfGLi86C/a5TF1Dvygo6 m/jA== X-Gm-Message-State: AOAM532yc8xPVst9Xgm3zbX/9oSpnJrgd8a4tyz3K+30QD/Uo3rlTXpx e5JCfZtbjA181LPpp0Bah0XhhB6O X-Google-Smtp-Source: ABdhPJz6nIsUP6vGZyQD51qipgSPYUqgLCOUGpr1JKtigewGjsmgZANkpVQblahOBTr6EZPD43+/Ww== X-Received: by 2002:a1c:998c:: with SMTP id b134mr9458985wme.78.1591194107136; Wed, 03 Jun 2020 07:21:47 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id c143sm4358355wmd.1.2020.06.03.07.21.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Jun 2020 07:21:45 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=raaahh@gmail.com; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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:251808 Archived-At: On 03.06.2020 16:59, Konstantin Kharlamov wrote: > I am not sure why you say it seems wasteful. Do you mean perhaps, as > opposed to setting, say, 100ms? Or 50ms, maybe. Wasteful of CPU cycles and laptop battery, I'd say. Of course, the exact impact depends on the size of your project. > 100ms I think is the top limit this > timeout should be set. The defaults are not set in stone, we can discuss changing them on the company issue tracker. But it's a balancing act. Set the value too small -- and the result is more likely to annoy people who don't rely on the popup as much. > 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. Should I take this to mean the completion request itself took 156ms to finish? >> 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. Indeed, that's what asynchronous means. But the quality of the user experience also depends on how quickly the backing server can handle those requests. > 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? The majority of backends are synchronous. And the "standard" completion API for Emacs (which we want to integrate with) still only supports the synchronous convention.