Katsumi Yamaoka <[EMAIL PROTECTED]> writes:

> Hi,

Hi,

> I'm using latest Emacs and Tramp both checked out from CVS.
> When I performed the `f' command in order to open a file in the
> dired buffer for the directory:
>
> /ftp:[EMAIL PROTECTED]:/somewhere/
>
> it attempts to connect to the remotehost as an anonymous user.

Strange. I could reproduce it here.

> It is because the default value for the ange-ftp-name-format
> variable is not suitable to Tramp file names:
>
> (ange-ftp-ftp-name "/ftp:[EMAIL PROTECTED]:/somewhere/file")
>  => ("ftp" "anonymous" "[EMAIL PROTECTED]:/somewhere/file")

But Tramp handles this case. See tramp-ftp-file-name-handler in
tramp-ftp.el, where ange-ftp-name-format is redefined locally.

Looks like ange-ftp-ftp-name has been called outside Tramp, and
afterwards Tramp accesses the same file. There is an optimization in
ange-ftp-ftp-name, reusing ange-ftp-ftp-name-arg and
ange-ftp-ftp-name-res if possible.

Don't know how this could happen ...

Nevertheless, I did commit a patch to Tramp CVS unsetting
ange-ftp-ftp-name-arg and ange-ftp-ftp-name-res before giving control
to ange-ftp. This seems to solve the problem.

> The leading "ftp:" is needed when I want to use ftp rather than
> ssh because of the default value of tramp-default-method.  I've
> confirmed that the problem can be fixed by improving the default
> value for the ange-ftp-name-format variable as follows:
>
> (setq ange-ftp-name-format
>       '("^/\\(?:ftp:\\)?\\(?:\\([^/:]*\\)@\\)?\\([^@/:]*[^@/:.]\\):\\(.*\\)"
>       2 1 3))
>
> I greatly appreciate if someone modifies the Emacs source code.

This would be another solution. But Tramp is intended to work with
older Emacsen (older ange-ftp), too. So I would prefer to solve it
inside Tramp.

Please check, whether the fix in CVS, together with the original
ange-ftp, solves the problem.

> Thanks in advance,

Best regards, Michael.



_______________________________________________
Tramp-devel mailing list
[EMAIL PROTECTED]
http://mail.nongnu.org/mailman/listinfo/tramp-devel

Reply via email to