GNU bug report logs - #10085
24.0.91; completion-pcm--find-all-completions returns wrong remote file names

Previous Next

Package: emacs;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Sun, 20 Nov 2011 16:00:01 UTC

Severity: normal

Found in version 24.0.91

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 10085 <at> debbugs.gnu.org
Subject: bug#10085: 24.0.91; completion-pcm--find-all-completions returns wrong remote file names
Date: Wed, 27 Apr 2016 20:37:54 +0200
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

Hi Stefan,

>> Tramp does not know of programmed completion and pcm style completion;
>> all what it knows is file-name-all-completions.
>> What else could Tramp do?
>
> Tramp has control via file-name-directory.
>
> OK, here are some inconsistencies I found just now in emacs-25:
>
>     ELISP> (completion-boundaries "/sudo:" #'completion-file-name-table nil "")
>     (6 . 0)
>     
>     ELISP> (let ((non-essential t)) (completion-boundaries "/sudo:"
>     ELISP> #'completion-file-name-table nil ""))
>     (1 . 0)
>
> In the above the first answer looks good to me.
> The second looks wrong: it should be the same as the first.
> This is controlled by Tramp via (file-name-directory "/sudo:").

That's true, there is a bug:

(file-name-directory "/sudo:") => "/sudo:"
(let ((non-essential t)) (file-name-directory "/sudo:")) => "/"

The second answer is wrong, indeed. I will check what's up. 

>     ELISP> (all-completions "/sudo:" #'completion-file-name-table)
>     *** Eval error ***  Host name must not match method "sudo"
>     ELISP> (let ((non-essential t)) (all-completions "/sudo:"
>     ELISP> #'completion-file-name-table))
>     ("sudo:root@")
>
> The first answer above looks wrong (there's no reason for Tramp to
> assume that "/sudo:" uses "sudo" as a host name, and indeed in the
> second case it correctly interprets "sudo" as a method rather than
> a host name).

Hmm, "/sudo:" is a valid remote file name. It uses as method the value
of `tramp-default-host', and as host the string between "/" and
":". That's how it is specified. How shall Tramp know from the
syntactical point of view, that "sudo" is meant as method? It cannot,
unless somebody tells it to Tramp, for example by let-binding
`non-essential'.

> Assuming we fix the completion-boundaries to be (6 . 0) the second
> answer (which comes from `file-name-all-completions "" "/sudo:") should
> be ("root@").
>
> Fixing those inconsistencies should fix bug#10085.

I see. I will check what could be done on Tramp side. Whatever I'll do,
it will go into master.

(Being busy just now, it might take the weekend to work on this. Sorry.)

>         Stefan

Best regards, Michael.




This bug report was last modified 9 years and 22 days ago.

Previous Next


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