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 #68 received at 50387 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Gregory Heytings <gregory <at> heytings.org>
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:23:08 +0200
Gregory Heytings <gregory <at> heytings.org> writes:

>> Alas it doesn't.
>>
>> emacs -Q -l tramp --eval "(add-to-list 'completion-styles 'substring)"
>>
>> C-x C-f /scp: TAB
>>
>> still shows "Sole completion".

In order to see what Tramp does, I have called

--8<---------------cut here---------------start------------->8---
# emacs -Q -l tramp --eval "(add-to-list 'completion-styles 'substring)" --eval "(trace-function-background 'tramp-completion-handle-file-name-all-completions)"
--8<---------------cut here---------------end--------------->8---

> Sorry, I typed too fast.  It displays two completion candidates:
> "pscp:" and "scp:", which is not what one expects at that point.

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

--8<---------------cut here---------------start------------->8---
======================================================================
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:")
--8<---------------cut here---------------end--------------->8---

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.

> With tramp-default-method set to "ssh", C-x C-f /ssh: TAB still
> displays "Sole completion".

Now I have called

--8<---------------cut here---------------start------------->8---
# emacs -Q -l tramp --eval "(add-to-list 'completion-styles 'substring)" --eval "(trace-function-background 'tramp-completion-handle-file-name-all-completions)" --eval '(setq tramp-default-method "ssh")'
--8<---------------cut here---------------end--------------->8---

Calling "C-x C-f /ssh: TAB" gives me indeed "Sole completion", and
*trace-output* still contains

--8<---------------cut here---------------start------------->8---
======================================================================
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:")
--8<---------------cut here---------------end--------------->8---

This also looks proper to me.

From the Tramp POV, there's no problem I believe. How completion
packages call file-name-all-completions, and how they interpret the
result, is out of Tramp's responsibility.

Best regards, Michael.




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

Previous Next


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