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

From: Michael Albinus <[email-masked]>
Date: Mon, 06 Sep 2021 22:31:31 +0200

Gregory Heytings <[email-masked]> writes:

Hi Gregory,

> * lisp/net/tramp.el (tramp-completion-handle-file-name-all-completions):
> Do not return methods when the filename already contains a complete method.
> Fixes bug#50387.

I don't see this implemented. You rather don't return methods when the
filename does not contain a possible method string at all.

>  	    ;; Possible methods.
> -	    (setq result
> -		  (append result (tramp-get-completion-methods m)))))))
> +	    (unless (or (string-empty-p method)
> +		        (string-empty-p user)
> +		        (string-empty-p host))

The check for (string-empty-p user) and (string-empty-p host) wouldn't
be needed, you are in the else branch of (or user host). IOW, user and
host are already nil, nothing left to test for them.

But I'm not convinced this is the proper solution. I still don't
understand why the default method must be suppressed.

Best regards, Michael.