GNU bug report logs - #50387
Possible bug in Tramp or in completions

Previous Next

Package: emacs;

Reported by: Gregory Heytings <gregory <at> heytings.org>

Date: Sun, 5 Sep 2021 00:45:01 UTC

Severity: normal

Done: Gregory Heytings <gregory <at> heytings.org>

Bug is archived. No further changes may be made.

Full log


Message #74 received at 50387 <at> debbugs.gnu.org (full text, mbox):

From: Gregory Heytings <gregory <at> heytings.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 50387 <at> debbugs.gnu.org
Subject: Re: bug#50387: Possible bug in Tramp or in completions
Date: Tue, 07 Sep 2021 16:46:00 +0000
>
> 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.

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.  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.

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");

- now C-x C-f / TAB displays all Tramp methods;

- with my patch, which actually fixes the bug, C-x C-f / TAB does not 
display any Tramp method, as it should.




This bug report was last modified 3 years and 258 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.