From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#60505: 29.0.60; Fido Mode and Tramp Completion Date: Wed, 01 Feb 2023 18:12:43 +0000 Message-ID: <43562d4dd9c31382eb40@heytings.org> References: <87k024918k.fsf@jroy.ca> <8dea9f3e0e411c315b04@heytings.org> <87tu15m6g7.fsf@gmx.de> <8dea9f3e0eb47ac9e4ab@heytings.org> <371ba1d0be1f14c7c798@heytings.org> <8aadf0ddd54d67a3213d@heytings.org> <87a62jmwj6.fsf@gmx.de> <87o7qwm3dd.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vzW7NJwnZF" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6577"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60505@debbugs.gnu.org, Julien Roy To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 01 19:13:11 2023 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 1pNHba-0001Tl-Ah for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Feb 2023 19:13:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNHbU-0002x5-LX; Wed, 01 Feb 2023 13:13:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNHbS-0002wp-NI for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2023 13:13:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNHbS-0001t5-Ed for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2023 13:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNHbS-0006Dy-AH for bug-gnu-emacs@gnu.org; Wed, 01 Feb 2023 13:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Feb 2023 18:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60505 X-GNU-PR-Package: emacs Original-Received: via spool by 60505-submit@debbugs.gnu.org id=B60505.167527516823904 (code B ref 60505); Wed, 01 Feb 2023 18:13:02 +0000 Original-Received: (at 60505) by debbugs.gnu.org; 1 Feb 2023 18:12:48 +0000 Original-Received: from localhost ([127.0.0.1]:59810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNHbE-0006DT-7x for submit@debbugs.gnu.org; Wed, 01 Feb 2023 13:12:48 -0500 Original-Received: from heytings.org ([95.142.160.155]:39368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNHbB-0006DK-BR for 60505@debbugs.gnu.org; Wed, 01 Feb 2023 13:12:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1675275164; bh=Yx7ma8jNdC15VRBF4R0WUmlmNYteBob5Ipp3GO/md5I=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=KANth9v11JL5cCP4IiCSPQc6i3wlD+lOpnccwTUfio8YOiPKND4v6DDMsLLZ25VsF Mwg6rMyZe0JSiq/d+NbdZz06cfHqvmeJDd/gzbZXf+IN3DxAxTmHCmh2ayb4jdtT45 KMPx2akFKhL8A8dkEhEdnP2rBBo95XA8gTju+CqmGJOO88BC40QPglcp7xXYOOCh1v I3LPZNTHxU0MyLdq9OdieGh+J5epVeq6wyFbXLB62Y1SPYKc8Pl7jLtsvlDENPPvVp QH/bjn0mUAuhuyhgSHPR2sHC4B3H3JZd/hKP9BUWkZOhQdfWiBW0YxGMDdbZb5ep7F T/juDj/G4qLwQ== In-Reply-To: <87o7qwm3dd.fsf@gmx.de> Content-ID: <43562d4dd9189a416af0@heytings.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254596 Archived-At: --vzW7NJwnZF Content-Type: text/plain; charset=us-ascii; format=flowed Content-ID: <43562d4dd9e1ad6a9acb@heytings.org> >> It's correct that the same problem is present in Emacs 28, but it is >> not in Emacs 27, so it's a regression. As I tried to explain in >> bug#50387, the problem is that once Tramp is loaded, Tramp methods are >> returned when completions are requested for a root directory ("/"). >> This problem is even worse since commit d5c6bf9625: prior to that >> commit only the 'scp' and 'scpx' methods were returned (in emacs -Q), >> now all methods are returned. And this confuses the flex and substring >> completion mechanisms. > > Yes. But this is not a Tramp fault. > It definitely is Tramp's "fault". > > Completion styles like flex (and substring, didn't test) do ignore Tramp > file name syntax. They simply think in terms of file name parts, > separated by "/". This is not appropriate for remote file names. > What filenames are is defined for example by POSIX in its Definitions chapter ("Filename", "Pathname", "Pathname Resolution"). It is quite clear in those definitions that there is no place for a _method_ or a _host name_ in file names. Something with a method, a host name and a path is a different beast: it's an URI. And it's not a coincidence if (absolute) file names start with a slash, and URI do _not_ start with a slash. Tramp decided, for a reason I do not clearly understand, to invent URIs starting with a slash. File name completion mechanisms rightly assume that file names correspond to the standard syntax of file names, and there is no reason (and, for that matter, no reliable way) to fix the current problem at the level of completion styles. So I have yet another proposal: add a variable to let users (and modes) decide whether Tramp methods should be returned when completions for the root directory are requested. Patch attached. --vzW7NJwnZF Content-Type: text/x-diff; name=Improve-handling-of-Tramp-methods-by-completion-styl.patch; charset=us-ascii Content-Transfer-Encoding: base64 Content-ID: <43562d4dd97a1fb91d2d@heytings.org> Content-Disposition: attachment; filename=Improve-handling-of-Tramp-methods-by-completion-styl.patch RnJvbSBlMDQ5YTI1NTk5YzhhYmY2OTNiMzU3MzZlNzZiYTQ0MTJjYmM3Y2Jj IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBXZWQsIDEgRmVi IDIwMjMgMTg6MDY6NDkgKzAwMDANClN1YmplY3Q6IFtQQVRDSF0gSW1wcm92 ZSBoYW5kbGluZyBvZiBUcmFtcCBtZXRob2RzIGJ5IGNvbXBsZXRpb24gc3R5 bGVzLg0KDQoqIGxpc3AvbmV0L3RyYW1wLmVsICh0cmFtcC1tZXRob2RzLWlu LWNvbXBsZXRpb25zKTogTmV3IGRlZmN1c3RvbS4NCih0cmFtcC1jb21wbGV0 aW9uLWhhbmRsZS1maWxlLW5hbWUtYWxsLWNvbXBsZXRpb25zKTogVXNlIGl0 Lg0KDQoqIGxpc3AvaWNvbXBsZXRlLmVsIChpY29tcGxldGUtLWZpZG8tbW9k ZS1zZXR1cCk6IEFkZCAnYmFzaWMnDQphZnRlciAnZmxleCcgaW4gdGhlIGNv bXBsZXRpb24gc3R5bGVzLCBmb3IgY2FzZXMgd2hlcmUgJ2ZsZXgnIGRvZXMN Cm5vdCByZXR1cm4gYW55dGhpbmcuICBUaGlzIGlz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IGljb21wbGV0ZS1oaWRlLWNvbW1vbi1wcmVmaXggbmlsDQogICAg ICAgICAgICAgICAgIGljb21wbGV0ZS1zY3JvbGwgKG5vdCAobnVsbCBpY29t cGxldGUtdmVydGljYWwtbW9kZSkpDQotICAgICAgICAgICAgICAgIGNvbXBs ZXRpb24tc3R5bGVzICcoZmxleCkNCisgICAgICAgICAgICAgICAgOzsgVGhl ICdiYXNpYycgc3R5bGUgaXMgcmVxdWlyZWQgYnkgVHJhbXAuICBTZWUNCisg ICAgICAgICAgICAgICAgOzsgYnVnIzUxMzg2LCBidWcjNTI3NTgsIGJ1ZyM1 MzUxMywgYnVnIzU0MDQyIGFuZA0KKyAgICAgICAgICAgICAgICA7OyBidWcj NjA1MDUuDQorICAgICAgICAgICAgICAgIGNvbXBsZXRpb24tc3R5bGVzICco ZmxleCBiYXNpYykNCisgICAgICAgICAgICAgICAgOzsgVGVsbCBUcmFtcCB0 byBkaXNwbGF5IGl0cyBtZXRob2RzIGxhemlseS4NCisgICAgICAgICAgICAg ICAgdHJhbXAtbWV0aG9kcy1pbi1jb21wbGV0aW9ucyBuaWwNCiAgICAgICAg ICAgICAgICAgY29tcGxldGlvbi1mbGV4LW5vc3BhY2UgbmlsDQogICAgICAg ICAgICAgICAgIGNvbXBsZXRpb24taWdub3JlLWNhc2UgdA0KICAgICAgICAg ICAgICAgICByZWFkLWJ1ZmZlci1jb21wbGV0aW9uLWlnbm9yZS1jYXNlIHQN CmRpZmYgLS1naXQgYS9saXNwL25ldC90cmFtcC5lbCBiL2xpc3AvbmV0L3Ry YW1wLmVsDQppbmRleCAxOTE2ZDUwYWYwMy4uNTMzMTg2ZDE2MzMgMTAwNjQ0 DQotLS0gYS9saXNwL25ldC90cmFtcC5lbA0KKysrIGIvbGlzcC9uZXQvdHJh bXAuZWwNCkBAIC04MTIsNiArODEyLDIxIEBAIHRyYW1wLXN5bnRheA0KICAg OmluaXRpYWxpemUgIydjdXN0b20taW5pdGlhbGl6ZS1kZWZhdWx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