[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ange-ftp-name-format needs to be improved
From: |
Michael Albinus |
Subject: |
Re: ange-ftp-name-format needs to be improved |
Date: |
Sat, 24 Jan 2004 21:21:01 +0100 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux) |
Katsumi Yamaoka <address@hidden> 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:address@hidden:/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:address@hidden:/somewhere/file")
> => ("ftp" "anonymous" "address@hidden:/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.
- Re: ange-ftp-name-format needs to be improved,
Michael Albinus <=
- Re: ange-ftp-name-format needs to be improved, Katsumi Yamaoka, 2004/01/26
- Tramp ftp bug (was Re: ange-ftp-name-format needs to be improved), Katsumi Yamaoka, 2004/01/26
- ange-ftp problem (was: ange-ftp-name-format needs to be improved), Michael Albinus, 2004/01/28
- Re: ange-ftp problem, Katsumi Yamaoka, 2004/01/28
- Re: ange-ftp problem (was: ange-ftp-name-format needs to be improved), Stefan Monnier, 2004/01/28
- Re: ange-ftp problem, Juri Linkov, 2004/01/28
- Re: ange-ftp problem, Stefan Monnier, 2004/01/29
- Re: ange-ftp problem, Michael Albinus, 2004/01/29
- Re: ange-ftp problem, Juri Linkov, 2004/01/29
- Re: ange-ftp problem, Stefan Monnier, 2004/01/29