From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#29833: icomplete re-build the completion table after each key press Date: Mon, 21 Sep 2020 13:47:20 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31799"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 29833@debbugs.gnu.org To: Shuguang Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 21 19:55:29 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kKQ2C-000886-Ro for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 19:55:28 +0200 Original-Received: from localhost ([::1]:34338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKQ2B-0006lc-O2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 13:55:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKPv0-00074V-Lp for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 13:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKPv0-00011c-AA for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 13:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kKPv0-0003dW-8i for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 13:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Sep 2020 17:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29833 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 29833-submit@debbugs.gnu.org id=B29833.160071045413942 (code B ref 29833); Mon, 21 Sep 2020 17:48:02 +0000 Original-Received: (at 29833) by debbugs.gnu.org; 21 Sep 2020 17:47:34 +0000 Original-Received: from localhost ([127.0.0.1]:56109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKPuY-0003co-91 for submit@debbugs.gnu.org; Mon, 21 Sep 2020 13:47:34 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKPuX-0003cc-2v for 29833@debbugs.gnu.org; Mon, 21 Sep 2020 13:47:33 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 818C28009B; Mon, 21 Sep 2020 13:47:27 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id F018080921; Mon, 21 Sep 2020 13:47:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1600710441; bh=mkBCA6U+ixyqFaRMpIqEsMGIcfWydWeJ8ifrv/neoWE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=HiFSbIdfSiogxUM7IGBX0sR3WJP9m4TEovCqmNofoH0qFtxvHenubsm2hqulox3EX QW3Xhdt4o9NE3XPfa1HqubD7HG4c/GiwKQtwOvVmmZ+X5ZoQfnO8WT47wkHRhgObkA fvIBwNmBHmvUgzZ1KfninjeKZrOg/F+zy83oKdCc6kXPvQFoB1wvoHR18VNBkCqbfZ SmGg6pSrw7XA7eRF3VouGPLCZUbrbH21Dqgg5rbIQbdrNhkAyEeh23/JT+QLN6g4aU hmht/Bd81//rYawBlfLocJPAceGHAKpxl9l6FRLEHDIDLMUd5a97MssLOlZg3uP75D VqHFKqKBCmSwg== Original-Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C0ED3120201; Mon, 21 Sep 2020 13:47:21 -0400 (EDT) In-Reply-To: (Shuguang Sun's message of "Sun, 24 Dec 2017 16:58:28 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188626 Archived-At: > The icomplete re-build the completion table > 'completion-all-sorted-completions' after each key press. This is considered normal. The reason is that icomplete can't know in general how to take the list of matching completions for "foob" or for "fo" (or for any other string for that matter) and compute the corresponding list of matching completions. This is because it depends on lots of details. E.g. when completing files when going from "foo" to "foo/" the list of completions is completely changed. In other cases, "foo" matches something using a particular completion-style but "foob" doesn't, so a different completion-style will be used, ... It is true that in many case the completions of "foob" are a subset of the completions of "foo", so we could recompute them faster but icomplete is not being told under which conditions this is true and it's not being told *how* it could be recomputed (e.g. by looking for candidates matching "foob" or by looking for candidates matching "f.*o.*o.*b", ...). So in order to be able to avoid recomputing the candidates "from scratch", we'd need the rest of the completion code to give us more info, but there is no such infrastructure. What the current completion system expects instead is that if the time needed to recompute the candidates can be large, the *completion table* should use a cache. Stefan