From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#50387: Possible bug in Tramp or in completions Date: Tue, 07 Sep 2021 19:31:51 +0200 Message-ID: <871r60cmwo.fsf@gmx.de> References: <79cd87e590549c0d916d@heytings.org> <79cd87e590b404a83d08@heytings.org> <8735qi3yn0.fsf@gmx.de> <75d560562c0ab9fd3910@heytings.org> <87r1e1ej2y.fsf@gmx.de> <75d560562c20d8f71e17@heytings.org> <87h7exeh56.fsf@gmx.de> <75d560562c1f93d6a0f7@heytings.org> <877dftebod.fsf@gmx.de> <75d560562c385dda28c0@heytings.org> <87y289cuos.fsf@gmx.de> <75d560562c15a7c4aab4@heytings.org> <87eea0czkx.fsf@gmx.de> <11c4e3821a86a11e0b8f@heytings.org> <11c4e3821ab7d19109fb@heytings.org> <87a6kocvn7.fsf@gmx.de> <11c4e3821a544b043840@heytings.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14596"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Stefan Monnier , 50387@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 07 19:33:11 2021 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 1mNey6-0003bU-8u for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Sep 2021 19:33:10 +0200 Original-Received: from localhost ([::1]:59898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNey4-0006Hx-TL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Sep 2021 13:33:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNexy-0006Fu-DD for bug-gnu-emacs@gnu.org; Tue, 07 Sep 2021 13:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNexy-0003pK-4l for bug-gnu-emacs@gnu.org; Tue, 07 Sep 2021 13:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNexx-0002FO-OY for bug-gnu-emacs@gnu.org; Tue, 07 Sep 2021 13:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Sep 2021 17:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50387 X-GNU-PR-Package: emacs Original-Received: via spool by 50387-submit@debbugs.gnu.org id=B50387.16310359238537 (code B ref 50387); Tue, 07 Sep 2021 17:33:01 +0000 Original-Received: (at 50387) by debbugs.gnu.org; 7 Sep 2021 17:32:03 +0000 Original-Received: from localhost ([127.0.0.1]:57548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNex1-0002Dc-Bu for submit@debbugs.gnu.org; Tue, 07 Sep 2021 13:32:03 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:45533) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNewz-0002D6-OY for 50387@debbugs.gnu.org; Tue, 07 Sep 2021 13:32:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1631035913; bh=P5lKSftamN2ZHNY3RIclMqNenWLQwrBdqEa/hTkj6TI=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=F5fZvaKm2VT6IkVlvATJNzpy+soT3GM9liACAIhC7Ud+ZK3PXUkgSA0aXpdcTRDym aptJzlZTM0NJ4z+oYzRC3DCXLY4rJ7t8vQXxaTc7sxiNvPnOKLC7i2AaTDWYN41iPZ tWeoFcB3Cil2imJgXadXNmTF5NwcLHEVQz0nHvk8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.91.249.7]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtwUw-1nFV7V11Bc-00uKmK; Tue, 07 Sep 2021 19:31:53 +0200 In-Reply-To: <11c4e3821a544b043840@heytings.org> (Gregory Heytings's message of "Tue, 07 Sep 2021 16:46:00 +0000") X-Provags-ID: V03:K1:WG/0yTf/ihg/So/jQe6mOmGLqRYJkMZDwihJvt6GLjfv5rcMQoP cnJUhY7WhmrKGvFAHBSpTWbJGo6MQQU7V5OpCST7i1RxLz6qgobFSWENjYeWdprYo4AFr2h PIFglbIKu1oLWlHC3uuT4MlHPyHiP3gbjJyqFICuMQFIDHLfXU6KFqc/kTw2QuNjf3d4jxs lgY6KpqlLW+5YXJn3ubXg== X-UI-Out-Filterresults: notjunk:1;V03:K0:NvlDD7SjCiw=:LSf4TyWVoKTnUaqVGWsnup D6Bq+Enk9sIh8W3QVbooyWhbLf3X9Ti0cXQ795AJgTRAN+kwJ5TtqrwAr88/PtveY3qmwk7iu zrEyN72rqvSW1ARfEaGn1jaBjk4xUoSwosR0ikSyNWQtldZ27lpKjqsCd+s40WBiBDtwbbPHL 42Dvb9hYVL7fLhWlAlugBh3QXLJLDjXNJCEXl8TUljSOypIc6AIu4IsKkHGJG+Cf6KS6FB+5c D6ps59JS/Gj2KywetS+vXYqW3rEUfgF5lNW4GLlufN1udRz71Mvhqg72kYPeSidmZ64FOH7Jp xJLTgDXDKByzSez/bi35VsmHkofFR5VA3ovEQ21qtN0LislcQtR2/xDLWn9P0TQ0w9dDUXu0p f6CQo3ctq2nGYBXQ8BC7AE42M4hfVSoblKwtawv/5P5KpzQyIVoRhrMNO4I1Ggvd0dY7Bsvee oos1Dx9pNBS+LBfcn2ZUgvvawcW/wVUFT+oNe1bJEqcJg0yjNBhYIcScVh/2enxL/7CVXg9CT BuTvFU/GNI+SNjSG+Q3ywjaFJswE36pGMy3jzYWlEhkynihZ9IbNEeUimdPXgGSJ2Bzf5tyHV z27Yo6HXFrfLddJuFhiqTkfyQVM0bm3wdcFqBB75h/eMWCA4v3epIuo2FDqGhWWzzjnUKbB5r Rv1wDJ6mpL+jFch5NN7X+3ESaEDfhcAJcSomon78hpfkWyRwKU8kkT+e7XIACFvUacOUxo5QH rmcaTDpZ9Fj/WEq2PqMMeoRD+P+wDc4qbFdgIHhJG54CjkcU7xkz/LVtORjYESpKpln7By+e 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:213715 Archived-At: Gregory Heytings writes: Hi Gregory, >> When I type "C-x C-f /scp: TAB", I see the same result as you, >> "pscp:" and "scp:". However, the buffer *trace-output* contains >> >> ====================================================================== >> 1 -> (tramp-completion-handle-file-name-all-completions "" "/") >> 1 <- tramp-completion-handle-file-name-all-completions: ("sudoedit:" >> "sshfs:" "smb:" "rcp:" "remcp:" "scp:" "scpx:" "rsync:" "rsh:" >> "remsh:" "ssh:" "sshx:" "telnet:" "nc:" "su:" "sg:" "sudo:" "doas:" >> "ksu:" "krlogin:" "plink:" "plinkx:" "pscp:" "psftp:" "fcp:" >> "rclone:" "afp:" "dav:" "davs:" "gdrive:" "mtp:" "nextcloud:" >> "sftp:" "ftp:" "adb:") >> ====================================================================== >> 1 -> (tramp-completion-handle-file-name-all-completions "" "/") >> 1 <- tramp-completion-handle-file-name-all-completions: ("sudoedit:" >> "sshfs:" "smb:" "rcp:" "remcp:" "scp:" "scpx:" "rsync:" "rsh:" >> "remsh:" "ssh:" "sshx:" "telnet:" "nc:" "su:" "sg:" "sudo:" "doas:" >> "ksu:" "krlogin:" "plink:" "plinkx:" "pscp:" "psftp:" "fcp:" >> "rclone:" "afp:" "dav:" "davs:" "gdrive:" "mtp:" "nextcloud:" >> "sftp:" "ftp:" "adb:") >> >> That means, "scp:" hasn't been passed to >> tramp-completion-handle-file-name-all-completions, and the result of >> that function looks proper to me. > > Yet it isn't. Why not? In this example, `completion-styles' contains `substring'. And then you ask for completion of "/scp:". Looking at the candidates returned by `tramp-completion-handle-file-name-all-completions', only "pscp:" and "scp:" have the substring "scp:". Intuitively, I believe it is correct to show these two methods. > By the way, before your attempt to fix the problem, you would have seen: > > 1 -> (tramp-completion-handle-file-name-all-completions "" "/") > 1 <- tramp-completion-handle-file-name-all-completions: ("scp:" "scpx:") > > IOW, one side effect of your patch is that C-x C-f / TAB now displays > all Tramp methods. Yes. > And you said in your reply to Stefan: "For a completion of "/" Tramp > tries to be silent, in order not to surprise the many users which > don't use Tramp with candidates like "/adb:". They wouldn't know > what's that." I fully agree with that, and the problem is that Tramp > tried to be "too smart" here, and to display completions that > correspond to tramp-default-method, which confuses completion > mechanisms. Indeed, I have changed my mind. The initial intention of Tramp's method completion was to be not invasive, i.e. not to disturb Emacs users not interested in Tramp. Eli has reminded me, that we have changed Tramp later on such a way, that its completion happens only when Tramp is loaded. This wasn't the case before; Tramp was autoloaded just for its completion, which was not appreciated by the users not interested in Tramp. With that change, which is still preserved, there's no need for this restriction any longer, because a user will see Tramp's completion only after Tramp has been loaded. > IOW again: > > - before your attempt to fix the problem, C-x C-f / TAB only displayed > "scp:" and "scpx:" among the completion candidates (or e.g. "ssh:", > "sshfs:" and "sshx:" with tramp-default-method set to "ssh"); Yes, this is changed. > - now C-x C-f / TAB displays all Tramp methods; When Tramp is loaded. I regard this to be correct. > - with my patch, which actually fixes the bug, C-x C-f / TAB does not > display any Tramp method, as it should. Again, C-x C-f / TAB displays a Tramp method only when Tramp is loaded. What is wrong with this? Best regards, Michael.