emacs-devel
[Top][All Lists]
Advanced

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

Re: Tramp, "[]" in file names, and file-expand-wildcards


From: Stefan Monnier
Subject: Re: Tramp, "[]" in file names, and file-expand-wildcards
Date: Tue, 09 Oct 2001 11:57:36 -0400

> > From: "Stefan Monnier" <monnier+gnu/address@hidden>
> > Date: Tue, 09 Oct 2001 10:29:59 -0400
> > 
> > > Another possibility would be to invent a mechanism where each handler
> > > could register a priority, and higher-priority handlers would be
> > > called first.  That would allow a handler to DTRT no matter what is
> > > the order of loading the respective packages into Emacs.
> > 
> > I think it's the good and simple approach.
> > 
> > But based on the little bit of experience we have with various kinds of
> > handlers, it seems that the priority should reflect where the pattern 
> > matches
> > (things like jka-compr that match the very end should have the highest
> > priority, then come tar-file handlers and then ange-ftp like thingies).
> 
> If we know in advance in what order should we call certain handlers,
> we could codify that order as the default, and let handlers override
> it with a priority, when the default is somehow not good enough.
> 
> > The more I think about it the more I'm convinced that
> > "the largest (match-end 0)" is The Right Thing.
> 
> Isn't this because your examples all share a common attribute: they
> are all for file names which are recognized by their extensions?

No.  What it relies on is that the handler takes the file name,
splits it near the match and then uses Emacs file operations with
the left part while it might use non-Emacs file operations on
the right part (for example, will pass the right part through pipes
to sh commands or to an ftp client).  I.e. the left-hand will go
again through further handlers but the right-hand part won't.

> What happens if you have a file name like /cygdrive/d/foo/bar.tar.gz,
> where /cygdrive/d/ is the Cygwin magic?

That's just like Tramp and ange-ftp: it will first go through jka-compr
which will then pass /cygdrive/d/foo/bar.tar.gz again through the
handlers (but this time while disabling itself, so the cygwin magic
can happen).


        Stefan




reply via email to

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