emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: URL filename syntax?


From: Kim F. Storm
Subject: Re: URL filename syntax?
Date: 14 Apr 2003 17:05:36 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

address@hidden (Kai Großjohann) writes:

> Is it desirable to use URL-like syntax for remote files?

Summary: No.


> 
> Currently, Tramp uses this format:
> 
>     /method:address@hidden:localname
> 
> My idea is to use
> 
>     /method://address@hidden/localname
> 

For normal find-file syntax, // means to discard everything before the
second slash; thus, your suggested change may be hard to get through the
standard read-file-name function (without some changes at the C level).

Also, for a package like ido, the absense of any slashes in the "tramp
part" of the file name is a significant advantage when it comes to
parsing such strings and determining what is what [and given the
obscure ways tramp does method/user/server/file name completion, this
is necessary; look at the code in ido.el, if you don't believe me :-)]

>   I think we can't require our users to type %2F in such cases, and
>   therefore I propose to change the ftp URL syntax to interpret
>   ftp://address@hidden//foo as the file /foo on the remote host.  (And
>   ftp://address@hidden/foo refers to ~user/foo.)

Again, you are violating the principle that // has a special meaning
when entering a file name.

> 
> * Tramp allows to omit the method.  How do I do that with URLs?

///address@hidden/localname

[things get worse, right?]

> 
> * Tramp also supports multi-hop connections, with a syntax like
> 
>     /multi:hop1:hop2:...:hopN:localname
> 
>   where hopI looks like hop-method:address@hidden  So, for example,
> 
>     /multi:telnet:address@hidden:su:address@hidden:/etc/passwd
> 
>   means to use telnet to log in as user kai on marvin, then use
>   /bin/su there to become root, then access the file /etc/passwd.

With URL syntax, you would need to write // to access a file
from the root, ie.

     /multi://telnet:address@hidden/su:address@hidden//etc/passwd
 
or you would open ~root/etc/passwd,  right?

> 
>   In the rare case where one would like to access a file/directory
>   whose name contains a colon, one can add slashes.  So to access the
>   file "foo:bar" in root's homedir, one could use
> 
>     /multi:telnet:address@hidden:su:address@hidden:~/foo:bar
> 
>   which is unambiguous.

Ok, but I suppose that is a general problem, not specific to using the
URL syntax or not.

> 
>   Clearly, multi://telnet:address@hidden/su:address@hidden/foo:bar will
>   not work so well...  

Agree! 

>                        Hm.  But I could support ~, too, so this would
>   become multi://telnet:address@hidden/su:address@hidden/~/foo:bar which
>   is unambiguous.

And ugly.

I definitely prefer the current tramp syntax!  It does the job well,
has a tidy syntax, works well with read-file-name (and ido), and it
doesn't pretend to be something it ain't.

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]