[Top][All Lists]

[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: Simon Josefsson
Subject: Re: URL syntax (was: Re: Tramp, "[]" in file names, and file-expand-wildcards)
Date: Wed, 28 Nov 2001 22:59:17 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

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.

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.

Another alternative would be to change the concept of "filenames"
within Emacs into "URLs", so that if you want to access a local
filename you say file:~/.emacs or something.  With user interface help
(such as C-x C-f defaulting to opening file:'s) this might not be such
a big hassle.  But I guess this would be a too drastic change to make,
even though it makes sense to me.  Lots of programs are using URLs to
reference data instead of filenames (e.g., KDE).

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

reply via email to

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