Subject: bug#51386: 29.0.50; fido-vertical-mode: ssh host completion

From: Michael Albinus <[email-masked]>
Date: Tue, 26 Oct 2021 20:53:12 +0200

Gregory Heytings <[email-masked]> writes:

Hi Gregory,

>> Bonus point, if somebody who knows completion styles by heart could
>> fix this annoyance. Then we don't need to document it.
>>
>
> ??? I sent you a (one-line!) patch for the second annoyance, and you
> rejected it.  I'd be willing to look at the first annoyance, but not
> if it's to see the patch again rejected.

Your patch violates the file-name-all-completions API. Testing with
"emacs -Q -l tramp":

Currently, we have the following with vanilla Emacs (on my laptop):

--8<---------------cut here---------------start------------->8---
(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:" "sbin/" "proc/" "bin/" "snap/" "opt/" "var/" "dev/" "lib64/" "./" "nonexistent/" "lost+found/" "media/" "root/" "srv/" "etc/" "mnt/" "../" "tmp/" "net/" "sys/" "lib/" "boot/" "home/" "run/" "usr/")
--8<---------------cut here---------------end--------------->8---

With your one-line patch, we have instead

--8<---------------cut here---------------start------------->8---
(file-name-all-completions "" "/")
=> ("sbin/" "proc/" "bin/" "snap/" "opt/" "var/" "dev/" "lib64/" "./" "nonexistent/" "lost+found/" "media/" "root/" "srv/" "etc/" "mnt/" "../" "tmp/" "net/" "sys/" "lib/" "boot/" "home/" "run/" "usr/")
--8<---------------cut here---------------end--------------->8---

That means, all Tramp methods are suppressed. This is wrong, a valid
file name can start with a Tramp method. The Elisp manual calls such
cnstructs "magic" file names, but they are still valid file name
prefixes in the sense of file-name-all-completions. And so they are
valid results.

Our discrepancy is, that I believe we shall follow the API, and fix
problems where they are located. You want a workaround in Tramp, which
would IMO do more damage than it is good for. My experience tells me
that such hacks will create new problems we have to deal with in the
future.

Both of us agree that there is a problem. I don't intend to reject
patches from you, I just must be convinced that they solve the problem
adequately.

Best regards, Michael.