From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#41423: 27.0.91; eshell file completion in tramp dir is slow (3 minutes) [regression on pretest] Date: Tue, 1 Sep 2020 17:40:41 +0200 (CEST) Message-ID: References: <87mu2d7hka.fsf@gmx.de> Reply-To: Gregory Heytings Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13013"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.22 (NEB 394 2020-01-19) Cc: Tim Vaughan , rrandresf@gmail.com, Michael Albinus , 41423@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 01 17:41:14 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 1kD8PJ-0003Gk-4B for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Sep 2020 17:41:13 +0200 Original-Received: from localhost ([::1]:33068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kD8PI-0000Rf-69 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Sep 2020 11:41:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kD8P8-0000JA-KY for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 11:41:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kD8P8-0001IY-9u for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 11:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kD8P8-0000yh-71 for bug-gnu-emacs@gnu.org; Tue, 01 Sep 2020 11:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Sep 2020 15:41: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.15989748513734 (code B ref 41423); Tue, 01 Sep 2020 15:41:02 +0000 Original-Received: (at 41423) by debbugs.gnu.org; 1 Sep 2020 15:40:51 +0000 Original-Received: from localhost ([127.0.0.1]:56842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kD8Ow-0000yA-S9 for submit@debbugs.gnu.org; Tue, 01 Sep 2020 11:40:51 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:61112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kD8Ou-0000y0-Ax for 41423@debbugs.gnu.org; Tue, 01 Sep 2020 11:40:50 -0400 Original-Received: from sdf.org (IDENT:ghe@faeroes.freeshell.org [205.166.94.9]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 081FekvE010073 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 1 Sep 2020 15:40:46 GMT Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 081Fes4T026778; Tue, 1 Sep 2020 15:40:54 GMT In-Reply-To: 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:186856 Archived-At: > >> No, the bug is in the completion mechanism, not in eshell. I don't >> know exactly (because the mechanism is so complicated) where the >> completion functions should be fixed, but it is clear that there is no >> reason to call pcomplete-completions-at-point *three* times. > > The reason why it does so, is that it wants to know when a "completion > session" terminates, e.g. to hide the *Completions* buffer or to run the > exit-function. > > So it calls it: > > - once to do the actual completion. > - once per command in post-command-hook to see if we're done. > > Since in your example you have 2 commands (TAB and RET), that gives you > a total of 3. > Hmmm... It seems to me that in this case, we're done after the first call to pcomplete-completions-at-point, so the second call to pcomplete-completions-at-point in post-command-hook should see this (or at least could see this), and remove completion-in-region--postch from post-command-hook. RET would then not call pcomplete-completions-at-point anymore. > > This design relies on the fact that completion tables can be lazy, so it > should always be possible to make the completion-at-point-function very > cheap and harmless, so it's OK to call it repeatedly (or even > needlessly). > This is not at all documented AFAICS. Given that it's a crucial aspect for your design to work, it should be. > >> There is no reason to call pcomplete-completions-at-point when RET is >> pressed. > > If running that function is costly, it's a bug. > It was not before you declared `pcomplete' obsolete and removed `eshell-pcomplete'. > > That's how completion-at-point-functions was designed. > > If you want to change that design, be my guest, but it likely implies > changes to a fair bit of code, including outside Emacs. > I don't want to change that design, but I ask myself why you documented `pcomplete-completions-at-point' as follows: "Provide standard completion using pcomplete's completion tables. Same as `pcomplete' but using the standard completion UI." It's NOT the same as `pcomplete', it relies on different conditions. All completion functions called by `pcomplete-completions-at-point' should be checked and possibly changed with this new design. Given this, why did you declared `pcomplete' obsolete (it would make sense to have both a simple mechanism for simple cases and a more complex one for more complex cases), and why did you remove `eshell-pcomplete'?