Subject: Re: bug#50387: Possible bug in Tramp or in completions

From: Gregory Heytings <[email-masked]>
Date: Sun, 05 Sep 2021 12:49:00 +0000

I analyzed this bug a bit further, and the root problem is that

(tramp-completion-handle-file-name-all-completions "" "/")

returns ("sshfs:" "ssh:" "sshx:" ...) when tramp-default-method is "ssh", 
and ("scp:" "scpx:" ...) when tramp-default-method is "scp".

This happens because "possible methods" are added to the result in 
tramp-completion-handle-file-name-all-completions.

Therefore completion-substring-try-completion finds that "ssh:" is already 
a complete match.

I'm not sure how this bug should be fixed.  Removing these two lines from 
that function fixes the bug, but that's not really optimal because in that 
case /s TAB does not show "ssh:", "sshfs:" and "sshx:" anymore.  Not 
displaying these completions is perhaps better than not displaying 
hostnames, however.