unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 10085@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	[thread overview]
Message-ID: <87k2jiaoe5.fsf@gmx.de> (raw)
In-Reply-To: <jwvfuu79mua.fsf-monnier+bug#10085@gnu.org> (Stefan Monnier's message of "Wed, 27 Apr 2016 10:16:30 -0400")

Stefan Monnier <monnier@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.





  reply	other threads:[~2016-04-27 18:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-20 15:58 bug#10085: 24.0.91; completion-pcm--find-all-completions returns wrong remote file names Michael Albinus
2011-11-22 17:04 ` Stefan Monnier
2011-11-22 22:13   ` Michael Albinus
2011-11-22 23:05     ` Stefan Monnier
2011-11-23  6:43       ` Michael Albinus
2011-11-23 14:04         ` Stefan Monnier
2011-11-23 20:28           ` Michael Albinus
2011-11-24  2:10             ` Stefan Monnier
2016-04-27 14:16             ` Stefan Monnier
2016-04-27 18:37               ` Michael Albinus [this message]
2016-04-27 19:16                 ` Stefan Monnier
2016-05-02  7:19                   ` Michael Albinus
2011-11-22 19:05 ` Stefan Monnier
2011-11-22 21:55   ` Michael Albinus
2012-03-30 18:28 ` Stefan Monnier
2012-03-31 12:36   ` Michael Albinus
2012-03-31 15:29     ` Stefan Monnier
2016-04-23 20:08 ` bug#10085: Tramp method completions Live System User
2016-04-24  8:22   ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k2jiaoe5.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=10085@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).