I'm trying to make ido work sensibly with tramp syntax -- but
getting a grip on file-name-all-completions is really a nightmare.

Ido uses file-name-all-completions to get a list of all possible
completions of "the next component" to be entered by the user.

Now, consider these tramp file name:

     /method:[EMAIL PROTECTED]:/file
     /[EMAIL PROTECTED]:/file
     /host:/file

Ideally, ido would like to call file-name-all-completions like this:

         (file-name-all-completions "/method:" "")
         (file-name-all-completions "/method:user@" "")
         (file-name-all-completions "/method:[EMAIL PROTECTED]:" "")
         (file-name-all-completions "/method:[EMAIL PROTECTED]:/file" "")

         (file-name-all-completions "/user@" "")
         (file-name-all-completions "/[EMAIL PROTECTED]:" "")

         (file-name-all-completions "/host:" "")

However, this does not always work -- look at these examples:

========

(file-name-all-completions "/telnet:" "")
=> OK

========

(file-name-all-completions "/telnet:kfs@" "")
=> ERROR: "Not a tramp file name: "

The desired result can be obtained with this call
(remove leading / of first arg, add / to second arg):

(file-name-all-completions "telnet:kfs@" "/")
=> OK

========

(file-name-all-completions "/telnet:[EMAIL PROTECTED]:" "")
=> ERROR: "Not a tramp file name: "

The desired result can be obtained with this call
(swap the two args):

(file-name-all-completions "" "/telnet:[EMAIL PROTECTED]:")
=> OK

========

(file-name-all-completions "/telnet:[EMAIL PROTECTED]:/tmp" "")
=> ERROR: "Not a tramp file name: "

The desired result can be obtained with this call
(swap the two args):

(file-name-all-completions "" "/telnet:[EMAIL PROTECTED]:/tmp")
=> OK

========

Now, one would suppose that swapping the two args would work for
the first two forms above, but not so:

(file-name-all-completions "" "/telnet:")
=> ERROR: Login failed

(file-name-all-completions "/telnet:kfs@" "")
=> ERROR: Login failed



========

(file-name-all-completions "/kfs@" "")
=> OK

========

(file-name-all-completions "/[EMAIL PROTECTED]:" "")
=> ERROR: "Not a tramp file name: "

Swapping the args works here too:

(file-name-all-completions "" "/[EMAIL PROTECTED]:")
=> OK

========

(file-name-all-completions "/localhost:" "")
=> ERROR: "Not a tramp file name: "

Again swapping the args will work:

(file-name-all-completions "" "/localhost:")
=> OK

========

I have made ido adapt to all these strange rules, but it is not very
nice -- and I have to know whether /xxx: is a method or a host, since:

(file-name-all-completions "/telnet:" "")
=> OK

(file-name-all-completions "/localhost:" "")
=> FAILS

(file-name-all-completions "" "/telnet:")
=> FAILS

(file-name-all-completions "" "/localhost:")
=> OK


========

SIGH!!

Emacs  : GNU Emacs 22.0.50.54 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2005-10-14 on kfs-l.imdomain.dk
Package: tramp (2.0.51)


--
Kim F. Storm <[EMAIL PROTECTED]> http://www.cua.dk




_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to