[EMAIL PROTECTED] (Kim F. Storm) writes:

> I used it in ido, and it seems to work:
>
>              ;; work around bug in ange-ftp.
>              ;; /ftp:[EMAIL PROTECTED]: => nil
>              ;; /ftp:[EMAIL PROTECTED]:./ => ok
>              (and
>               (not (string= "/ftp:" dir))
>               (or
>                (string-match "\\`/ftp:.*:\\'" dir)
>                (and (string= tramp-default-method "ftp")
>                     (string-match "\\`/[^/:]+:\\'" dir)))
>               (file-name-all-completions "" (concat dir "./"))))))

This works for Tramp 2.0. It will work for Tramp 2.1 too, but there
are also other means to derive a default methold. For the time being
you might use a comment for this.

> There are still a small problem (I have worked around them in ido,
> so a fix is not urgent.)
>
> E.g. if I try
>
> (file-directory-p "/telnet:kfs@")
>  or
> (file-directory-p "/telnet:kfs@:")
>
> tramp signals "Login failure" in both cases.  

I know. This problem has eaten most of the time yesterday. In fact I
don't know a safe decision whether a file name shall be completed only
or "applied". Therefore I've introduced a new variable
tramp-completion-mode, which is set in
file-name-all-completions. Sensible Tramp file name functions, which
need to behave depending on the mode, check this variable (beside
other checks). So you might use it as well (untested, I'm @work):

(let ((tramp-completion-mode t))
  (file-directory-p "/telnet:kfs@"))

Best regards, Michael.



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

Reply via email to