emacs-devel
[Top][All Lists]
Advanced

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

Re: URL syntax (was: Re: Tramp, "[]" in file names, and file-expand-wild


From: William M. Perry
Subject: Re: URL syntax (was: Re: Tramp, "[]" in file names, and file-expand-wildcards)
Date: 29 Nov 2001 09:34:52 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50

Simon Josefsson <address@hidden> writes:

> address@hidden (William M. Perry) writes:
> 
> >> The URL file name handler doesn't seem to like being nestled:
> >> 
> >> (expand-file-name "foo" (file-name-as-directory
> >>                     (expand-file-name "foo:bar"
> >>                                       gnus-cache-directory)))
> >> "foo:foo"
> >> 
> >> it should return:
> >> 
> >> (expand-file-name "foo" (file-name-as-directory
> >>                     (expand-file-name "foo:bar"
> >>                                       gnus-cache-directory)))
> >> "/home/jas/News/cache/foo:bar/foo"
> >
> > I've got a preliminary fix for this in in my local workspace.  The problem
> > is that I put a generic regular expression on there that should match any
> > value URL scheme.  This unfortunately conflicts with some valid filenames
> > (gnus' cache files most noticably).
> >
> > The alternative is building up a gigantic regular expression like:
> >
> > ^\(hotlist\|vars\|util\|proxy\|privacy\|parse\|ns\|nfs\|news\|misc\|methods\|mailto\|ldap\|irc\|imap\|https\|http\|history\|handlers\|gw\|ftp\|file\|expand\|dired\|cookie\|cid\|cache\|auto\|auth\|about\|info\|man\|rlogin\|telnet\|tn3270\|data\|snews\):
> >
> > in the file-name-handlers-alist.  And then you lose if somebody writes a
> > new protocol loader and installs it.
> >
> > And I can't cheat and set the regexp to (...):// because not all schemes
> > have // in them. :(
> 
> None of this solves the case where you have a local filename which looks
> like a URL.

Well, we have this problem today with ange-ftp, and the URL regular
expression is only slightly more greedy than it is (no trailing slash) so
that Gnus gets hit.

> Is it possible to call a function to determine if a string should be
> handled by file name handler X?  Instead of matching a regexp on the
> filename, I mean.  If so, the function could be "clever" and figure out
> the most likely case, or perhaps even ask the user wheter the file should
> be regarded as a local filename or a URL.  Much like Mule.

You mean from a program like Gnus or from primitives like find-file?  You
can always call find-file-name-handler, but I'm not sure how appropriate
it would be to ask the user about this.  I would like to model it as
closely as possible against ange-ftp and efs.

> (I only wish Gnus used URLs instead of group names :-))

There has been some talk about this, but that is a huge migration pain.
They really aren't that far off now.  It would actually clean a few things
up:

nnimap+mail.mykungfuisthebest.net:IMAP/mail/gnu

vs:

nnimap://mail.mykungfuisthebest.net/IMAP/mail/gnu
or
nnimap://address@hidden/IMAP/mail/gnu



-bp
-- 
Ceterum censeo vi esse delendam



reply via email to

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