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#41423: 27.0.91; eshell file completion in tramp dir is slow (3 minutes) [regression on pretest] Date: Wed, 02 Sep 2020 12:36:38 -0400 Message-ID: References: <87mu2d7hka.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1166"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Michael Albinus , rrandresf@gmail.com, Tim Vaughan , 41423@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 02 18:40:49 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 1kDVoW-00009x-Ot for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Sep 2020 18:40:49 +0200 Original-Received: from localhost ([::1]:42794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDVoV-0007EU-RG for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Sep 2020 12:40:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDVkv-0001qS-QF for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2020 12:37:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48985) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kDVks-0005Bi-8L for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2020 12:37:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kDVks-0003PD-5P for bug-gnu-emacs@gnu.org; Wed, 02 Sep 2020 12:37: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: Wed, 02 Sep 2020 16:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41423 X-GNU-PR-Package: emacs Original-Received: via spool by 41423-submit@debbugs.gnu.org id=B41423.159906461013074 (code B ref 41423); Wed, 02 Sep 2020 16:37:02 +0000 Original-Received: (at 41423) by debbugs.gnu.org; 2 Sep 2020 16:36:50 +0000 Original-Received: from localhost ([127.0.0.1]:60531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDVkf-0003On-Up for submit@debbugs.gnu.org; Wed, 02 Sep 2020 12:36:50 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9317) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kDVkc-0003OZ-R6 for 41423@debbugs.gnu.org; Wed, 02 Sep 2020 12:36:48 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3208C440A00; Wed, 2 Sep 2020 12:36:41 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 723514409E5; Wed, 2 Sep 2020 12:36:39 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1599064599; bh=UtWRV6Ee9KHTUdxTRN62AiWvSOfCOq9HO8CTpHBnJjs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=OwUDqF74U6A39u+Vjuu5ObEki22coAhccZ6VuSiAaU6s4GcWKgFfsZIRXhoVXIO7E 6ad8njRzF7F/g53HDmutpr486lFxcyrKCDdm4SrhRnUBwXw/VLT8VNZAo4wtnN2HDk l2joeGKxM8r+DA+rPd7MderasslXFgWM1CAwHwdH6rC7xjQRe3Bw57jAEuqa6SpgHD H/ZYf3c7XnTDc2h3vtgeIGJGLMSKdgtSUi/jwnJW3ojmIHMckT9WCmvDBtYy8iIyhz D1z9LpQEtxXwyYyg9Pj2UlpcISx/9LZQRWGe8ER3sGp97BfX2F/pg3Go4N17kcw7jK 3luKdBFvceMKQ== Original-Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3B8561207B2; Wed, 2 Sep 2020 12:36:39 -0400 (EDT) In-Reply-To: (Gregory Heytings's message of "Wed, 02 Sep 2020 10:26:41 +0000") 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:186948 Archived-At: >> The lispref says the following: >> >> The functions on this hook should generally return quickly, since >> they may be called very often (e.g., from @code{post-command-hook}). >> Supplying a function for @var{collection} is strongly recommended if >> generating the list of completions is an expensive operation. Emacs >> may internally call functions in @code{completion-at-point-functions} >> many times, but care about the value of @var{collection} for only >> some of these calls. By supplying a function for @var{collection}, >> Emacs can defer generating completions until necessary. You can use >> @code{completion-table-dynamic} to create a wrapper function: >> > > I see, thanks for the pointer. I did not find this because I was searching > for `pcomplete-completions-at-point' and `pcomplete-completions'. It would > make sense to put this pointer in pcomplete.el. Indeed, it might make sense to add a reminder that `pcomplete-here` is the function where we "choose which completion table to use" and that this choice should always be quick (so if the set of candidates can take a while to compute, make sure the completion table computes it lazily). > It seems to me (even now that I understand the design of > `pcomplete-completion-at-point', and that I understand how the more > complex mechanism can be made as efficient as the simple one) that > this simple mechanism is often sufficient, that it is easier to > understand, and that it should remain available. You can definitely write such a "simple completion UI" on top of `completion-at-point-functions`, and make sure it calls things like `pcomplete-completion-at-point` only once. Basically, take `completion-at-point`, throw out the "minor mode" part and you're done. > What is still missing IMO is a general description/documentation of the > various parts of the completion mechanisms (completion-at-point, > completion-in-region, pcomplete, pcomplete-completion-at-point, > comint-completion-at-point, icomplete, ...) in Emacs behave and > interact. I was completely lost when I started working on this bug, things > are a bit clearer now, but still not very clear. I find it hard to write such things because I'm too familiar with it to know what's non-obvious. Maybe you could try writing something that you'd have found useful, and then we can collaboratively improve it? >> In the patch I sent I think there's a bug in that a leading * should >> change the START..END returned by `pcomplete-completion-at-point-function` >> so the `glob-name` computation should be done outside of the >> `completion-table-dynamic`. > *sigh* So this bug can still not be considered fixed? Yup :-( I'll try to come up with something better if noone else beats me to it. Stefan